mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
fix the refs logic for the addFast path for createBlock (#504)
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
10ba228e6b
commit
cc277e398b
|
@ -68,17 +68,20 @@ func createBlock(tb testing.TB, dir string, nSeries int, mint, maxt int64) strin
|
|||
|
||||
lbls, err := labels.ReadLabels(filepath.Join("testdata", "20kseries.json"), nSeries)
|
||||
testutil.Ok(tb, err)
|
||||
var ref uint64
|
||||
refs := make([]uint64, nSeries)
|
||||
|
||||
for ts := mint; ts <= maxt; ts++ {
|
||||
app := head.Appender()
|
||||
for _, lbl := range lbls {
|
||||
err := app.AddFast(ref, ts, rand.Float64())
|
||||
if err == nil {
|
||||
continue
|
||||
for i, lbl := range lbls {
|
||||
if refs[i] != 0 {
|
||||
err := app.AddFast(refs[i], ts, rand.Float64())
|
||||
if err == nil {
|
||||
continue
|
||||
}
|
||||
}
|
||||
ref, err = app.Add(lbl, int64(ts), rand.Float64())
|
||||
ref, err := app.Add(lbl, int64(ts), rand.Float64())
|
||||
testutil.Ok(tb, err)
|
||||
refs[i] = ref
|
||||
}
|
||||
err := app.Commit()
|
||||
testutil.Ok(tb, err)
|
||||
|
|
Loading…
Reference in a new issue