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

Function benchmarkData

pkg/ingester/ingester_test.go:960–978  ·  view source on GitHub ↗
(nSeries int)

Source from the content-addressed store, hash-verified

958}
959
960func benchmarkData(nSeries int) (allLabels []labels.Labels, allSamples []cortexpb.Sample) {
961 for j := range nSeries {
962 lbls := chunk.BenchmarkLabels.Copy()
963
964 builder := labels.NewBuilder(labels.EmptyLabels())
965 lbls.Range(func(l labels.Label) {
966 val := l.Value
967 if l.Name == "cpu" {
968 val = fmt.Sprintf("cpu%02d", j)
969 }
970
971 builder.Set(l.Name, val)
972 })
973
974 allLabels = append(allLabels, builder.Labels())
975 allSamples = append(allSamples, cortexpb.Sample{TimestampMs: 0, Value: float64(j)})
976 }
977 return
978}
979
980func TestIngesterMetricLimitExceeded(t *testing.T) {
981 limits := defaultLimitsTestConfig()

Callers 1

benchmarkIngesterPushFunction · 0.85

Calls 3

SetMethod · 0.65
CopyMethod · 0.45
LabelsMethod · 0.45

Tested by

no test coverage detected