mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
tests: fix slice init length (#6897)
### Describe Your Changes fix slice init length ### Checklist The following checks are **mandatory**: - [ ] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/). Signed-off-by: dufucun <dufuchun@sohu.com>
This commit is contained in:
parent
334cd92a6c
commit
95bafc8caf
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue