MCPcopy Index your code
hub / github.com/zalando/skipper / benchmarkRequest

Function benchmarkRequest

script/script_test.go:1041–1052  ·  view source on GitHub ↗
(b *testing.B, script string, params ...string)

Source from the content-addressed store, hash-verified

1039}
1040
1041func benchmarkRequest(b *testing.B, script string, params ...string) {
1042 f, _ := newFilter(LuaOptions{}, script, params...)
1043
1044 r, _ := http.NewRequest("GET", "http://example.com/test", nil)
1045 r.Header.Add("X-Foo", "Bar")
1046 fc := &filtertest.Context{FRequest: r}
1047
1048 b.ResetTimer()
1049 for i := 0; i < b.N; i++ {
1050 f.Request(fc)
1051 }
1052}
1053
1054func BenchmarkScriptRandomPath(b *testing.B) {
1055 benchmarkRequest(b, "testdata/random_path.lua", "/prefix/", "10")

Callers 2

Calls 3

newFilterFunction · 0.85
AddMethod · 0.65
RequestMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…