diff --git a/tsdb/chunkenc/benchmark_test.go b/tsdb/chunkenc/benchmark_test.go index bf72f855ef..1679158f16 100644 --- a/tsdb/chunkenc/benchmark_test.go +++ b/tsdb/chunkenc/benchmark_test.go @@ -80,7 +80,7 @@ func foreachFmtSampleCase(b *testing.B, fn func(b *testing.B, f fmtCase, s sampl { // Delta simulates delta type or worst case for cumulatives, where ST // is changing on every sample. - name: "vt=constant/st=delta", + name: "vt=constant/st=delta-exclusive", samples: func() (ret []triple) { t, v := initT, initV for range nSamples { @@ -91,6 +91,20 @@ func foreachFmtSampleCase(b *testing.B, fn func(b *testing.B, f fmtCase, s sampl return ret }(), }, + { + // Delta simulates delta type or worst case for cumulatives, where ST + // is changing on every sample. + name: "vt=constant/st=delta-inclusive", + samples: func() (ret []triple) { + t, v := initT, initV + for range nSamples { + st := t // ST is the same as the previous t. + t += 15000 + ret = append(ret, triple{st: st, t: t, v: v}) + } + return ret + }(), + }, { name: "vt=random steps/st=0", samples: func() (ret []triple) { @@ -198,7 +212,7 @@ func foreachFmtSampleCase(b *testing.B, fn func(b *testing.B, f fmtCase, s sampl }(), }, { - name: "vt=random 0-1/st=delta", + name: "vt=random 0-1/st=delta-exclusive", samples: func() (ret []triple) { t, v := initT, initV for range nSamples { @@ -210,6 +224,19 @@ func foreachFmtSampleCase(b *testing.B, fn func(b *testing.B, f fmtCase, s sampl return ret }(), }, + { + name: "vt=random 0-1/st=delta-inclusive", + samples: func() (ret []triple) { + t, v := initT, initV + for range nSamples { + st := t // ST is the same as the previous t. + t += int64(r.Intn(100) - 50 + 15000) // 15 seconds +- up to 100ms of jitter. + v += r.Float64() // Random between 0 and 1.0. + ret = append(ret, triple{st: st, t: t, v: v}) + } + return ret + }(), + }, } for _, f := range []fmtCase{