Home / Function/ Benchmark_Etag() — fiber Function Reference

Benchmark_Etag() — fiber Function Reference

Architecture documentation for the Benchmark_Etag() function in etag_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  1144acb7_fba5_0265_d187_7e57c4805c6c["Benchmark_Etag()"]
  dfd9dd18_1de2_7880_57b0_aa8836ab099f["etag_test.go"]
  1144acb7_fba5_0265_d187_7e57c4805c6c -->|defined in| dfd9dd18_1de2_7880_57b0_aa8836ab099f
  style 1144acb7_fba5_0265_d187_7e57c4805c6c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/etag/etag_test.go lines 267–290

func Benchmark_Etag(b *testing.B) {
	app := fiber.New()

	app.Use(New())

	app.Get("/", func(c fiber.Ctx) error {
		return c.SendString("Hello, World!")
	})

	h := app.Handler()

	fctx := &fasthttp.RequestCtx{}
	fctx.Request.Header.SetMethod(fiber.MethodGet)
	fctx.Request.SetRequestURI("/")

	b.ReportAllocs()

	for b.Loop() {
		h(fctx)
	}

	require.Equal(b, 200, fctx.Response.Header.StatusCode())
	require.Equal(b, `"13-1831710635"`, string(fctx.Response.Header.Peek(fiber.HeaderETag)))
}

Domain

Subdomains

Frequently Asked Questions

What does Benchmark_Etag() do?
Benchmark_Etag() is a function in the fiber codebase, defined in middleware/etag/etag_test.go.
Where is Benchmark_Etag() defined?
Benchmark_Etag() is defined in middleware/etag/etag_test.go at line 267.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free