MCPcopy Create free account
hub / github.com/cortexproject/cortex / BenchmarkSignRequest

Function BenchmarkSignRequest

pkg/cortexpb/extensions_test.go:13–36  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

11)
12
13func BenchmarkSignRequest(b *testing.B) {
14 ctx := context.Background()
15 ctx = user.InjectOrgID(ctx, "user-1")
16
17 tests := []struct {
18 size int
19 }{
20 {size: 10},
21 {size: 100},
22 {size: 1000},
23 {size: 10000},
24 }
25
26 for _, tc := range tests {
27 b.Run(fmt.Sprintf("WriteRequestSize: %v", tc.size), func(b *testing.B) {
28 wr := createWriteRequest(tc.size, true, "family1", "help1", "unit")
29 b.ReportAllocs()
30 for b.Loop() {
31 _, err := wr.Sign(ctx)
32 require.NoError(b, err)
33 }
34 })
35 }
36}
37
38func TestWriteRequest_Sign(t *testing.T) {
39 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

createWriteRequestFunction · 0.85
LoopMethod · 0.80
RunMethod · 0.65
SignMethod · 0.65

Tested by

no test coverage detected