MCPcopy
hub / github.com/gofiber/fiber / Benchmark_Ctx_Scheme

Function Benchmark_Ctx_Scheme

ctx_test.go:4944–4954  ·  view source on GitHub ↗

go test -v -run=^$ -bench=Benchmark_Ctx_Scheme -benchmem -count=4

(b *testing.B)

Source from the content-addressed store, hash-verified

4942
4943// go test -v -run=^$ -bench=Benchmark_Ctx_Scheme -benchmem -count=4
4944func Benchmark_Ctx_Scheme(b *testing.B) {
4945 app := New()
4946 c := app.AcquireCtx(&fasthttp.RequestCtx{})
4947
4948 var res string
4949 b.ReportAllocs()
4950 for b.Loop() {
4951 res = c.Scheme()
4952 }
4953 require.Equal(b, "http", res)
4954}
4955
4956// go test -run Test_Ctx_Scheme_TrustedProxy
4957func Test_Ctx_Scheme_TrustedProxy(t *testing.T) {

Callers

nothing calls this directly

Calls 3

AcquireCtxMethod · 0.80
NewFunction · 0.70
SchemeMethod · 0.65

Tested by

no test coverage detected