tsdb tests: allocate more reasonable sample slice
Typical parameters are one hour by 1 minute step, where the function would allocate a slice of 3.6 million samples instead of 60. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
72a48321da
commit
9853888f9b
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue