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

Function Benchmark_convertV2RequestToV1

pkg/util/push/push_test.go:210–224  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

208}
209
210func Benchmark_convertV2RequestToV1(b *testing.B) {
211 testSeriesNums := []int{100, 500, 1000}
212
213 for _, seriesNum := range testSeriesNums {
214 b.Run(fmt.Sprintf("%d series", seriesNum), func(b *testing.B) {
215 series := makeV2ReqWithSeries(seriesNum)
216
217 b.ReportAllocs()
218 for b.Loop() {
219 _, err := convertV2RequestToV1(series, false)
220 require.NoError(b, err)
221 }
222 })
223 }
224}
225
226func makeEncodedPRW2Body(b *testing.B, seriesNum, symbolCount int) (body []byte, contentLength int) {
227 b.Helper()

Callers

nothing calls this directly

Calls 4

makeV2ReqWithSeriesFunction · 0.85
convertV2RequestToV1Function · 0.85
LoopMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected