mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Merge pull request #11674 from bboreham/fix-tsdb-test-mem
tsdb tests: allocate more reasonable sample slice
This commit is contained in:
commit
54739a1465
|
@ -678,7 +678,7 @@ func genSeriesFromSampleGenerator(totalSeries, labelCount int, mint, maxt, step
|
||||||
for j := 1; len(lbls) < labelCount; j++ {
|
for j := 1; len(lbls) < labelCount; j++ {
|
||||||
lbls[defaultLabelName+strconv.Itoa(j)] = defaultLabelValue + strconv.Itoa(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 {
|
for t := mint; t < maxt; t += step {
|
||||||
samples = append(samples, generator(t))
|
samples = append(samples, generator(t))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue