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

Function makeEncodedPRW2Body

pkg/util/push/push_test.go:226–235  ·  view source on GitHub ↗
(b *testing.B, seriesNum, symbolCount int)

Source from the content-addressed store, hash-verified

224}
225
226func makeEncodedPRW2Body(b *testing.B, seriesNum, symbolCount int) (body []byte, contentLength int) {
227 b.Helper()
228 series := makeV2ReqWithSeriesAndSymbols(seriesNum, symbolCount)
229 protobuf, err := series.Marshal()
230 if err != nil {
231 b.Fatal(err)
232 }
233 encoded := snappy.Encode(nil, protobuf)
234 return encoded, len(encoded)
235}
236
237// runPRW2HandleFromPool simulates handlePRW2 using the sync.Pool
238func runPRW2HandleFromPool(ctx context.Context, body []byte, contentLength int, overrides *validation.Overrides, userID string) error {

Callers 1

Calls 3

EncodeMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected