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

Function generateSamplesForLabel

pkg/ingester/ingester_test.go:6932–6945  ·  view source on GitHub ↗
(l labels.Labels, count int, sampleIntervalInMs int)

Source from the content-addressed store, hash-verified

6930}
6931
6932func generateSamplesForLabel(l labels.Labels, count int, sampleIntervalInMs int) *cortexpb.WriteRequest {
6933 var lbls = make([]labels.Labels, 0, count)
6934 var samples = make([]cortexpb.Sample, 0, count)
6935
6936 for i := range count {
6937 samples = append(samples, cortexpb.Sample{
6938 Value: float64(i),
6939 TimestampMs: int64(i * sampleIntervalInMs),
6940 })
6941 lbls = append(lbls, l)
6942 }
6943
6944 return cortexpb.ToWriteRequest(lbls, samples, nil, nil, cortexpb.API)
6945}
6946
6947func Test_Ingester_ModeHandler(t *testing.T) {
6948 tests := map[string]struct {

Calls 1

ToWriteRequestFunction · 0.92

Tested by

no test coverage detected