Merge pull request #11674 from bboreham/fix-tsdb-test-mem

tsdb tests: allocate more reasonable sample slice
pull/11727/head
Ganesh Vernekar 2022-12-14 15:01:04 +05:30 committed by GitHub
commit 54739a1465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -678,7 +678,7 @@ func genSeriesFromSampleGenerator(totalSeries, labelCount int, mint, maxt, step
for j := 1; len(lbls) < labelCount; j++ {
lbls[defaultLabelName+strconv.Itoa(j)] = defaultLabelValue + strconv.Itoa(j)
}
samples := make([]tsdbutil.Sample, 0, maxt-mint+1)
samples := make([]tsdbutil.Sample, 0, (maxt-mint)/step+1)
for t := mint; t < maxt; t += step {
samples = append(samples, generator(t))
}