diff --git a/app/vmalert/rule/group_timing_test.go b/app/vmalert/rule/group_timing_test.go index c233ed34d..94399c490 100644 --- a/app/vmalert/rule/group_timing_test.go +++ b/app/vmalert/rule/group_timing_test.go @@ -11,7 +11,7 @@ import ( func BenchmarkGetStaleSeries(b *testing.B) { ts := time.Now() n := 100 - payload := make([]prompbmarshal.TimeSeries, n) + payload := make([]prompbmarshal.TimeSeries, 0, n) for i := 0; i < n; i++ { s := fmt.Sprintf("%d", i) labels := toPromLabels(b, diff --git a/lib/streamaggr/streamaggr_timing_test.go b/lib/streamaggr/streamaggr_timing_test.go index 5901e56ad..de7c49c1b 100644 --- a/lib/streamaggr/streamaggr_timing_test.go +++ b/lib/streamaggr/streamaggr_timing_test.go @@ -79,7 +79,7 @@ func newBenchAggregators(outputs []string, pushFunc PushFunc) *Aggregators { } func newBenchSeries(seriesCount int) []prompbmarshal.TimeSeries { - a := make([]string, seriesCount) + a := make([]string, 0, seriesCount) for j := 0; j < seriesCount; j++ { s := fmt.Sprintf(`http_requests_total{path="/foo/%d",job="foo_%d",instance="bar",pod="pod-123232312",namespace="kube-foo-bar",node="node-123-3434-443",`+ `some_other_label="foo-bar-baz",environment="prod",label1="value1",label2="value2",label3="value3"} %d`, j, j%100, j*1000)