Signed-off-by: Owen Williams <owen.williams@grafana.com>
This commit is contained in:
Owen Williams 2026-04-14 09:54:14 -04:00
parent 2e82200362
commit 693761ba6e
No known key found for this signature in database
GPG Key ID: 711C61A216D34A69
4 changed files with 19 additions and 14 deletions

View File

@ -121,8 +121,8 @@ var (
testrecord.WorstCase1000WithSTSamples,
}
versions = []struct {
name string
enableST bool
name string
enableST bool
}{
{"V1", false},
{"V2", true},
@ -134,7 +134,8 @@ var (
-run '^$' -bench '^BenchmarkEncode_Samples' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee encode.txt
benchstat -col /version encode.txt
benchstat -col /version encode.txt
*/
func BenchmarkEncode_Samples(b *testing.B) {
for _, ver := range versions {
@ -176,7 +177,8 @@ func BenchmarkEncode_Samples(b *testing.B) {
-run '^$' -bench '^BenchmarkDecode_Samples' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee decode.txt
benchstat -col /version decode.txt
benchstat -col /version decode.txt
*/
func BenchmarkDecode_Samples(b *testing.B) {
for _, ver := range versions {
@ -228,7 +230,8 @@ var (
-run '^$' -bench '^BenchmarkEncode_Histograms' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee encode-hist.txt
benchstat -col /version encode-hist.txt
benchstat -col /version encode-hist.txt
*/
func BenchmarkEncode_Histograms(b *testing.B) {
for _, ver := range versions {
@ -282,7 +285,8 @@ func BenchmarkEncode_Histograms(b *testing.B) {
-run '^$' -bench '^BenchmarkDecode_Histograms' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee decode-hist.txt
benchstat -col /version decode-hist.txt
benchstat -col /version decode-hist.txt
*/
func BenchmarkDecode_Histograms(b *testing.B) {
for _, ver := range versions {
@ -337,7 +341,8 @@ func BenchmarkDecode_Histograms(b *testing.B) {
-run '^$' -bench '^BenchmarkEncode_FloatHistograms' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee encode-fhist.txt
benchstat -col /version encode-fhist.txt
benchstat -col /version encode-fhist.txt
*/
func BenchmarkEncode_FloatHistograms(b *testing.B) {
for _, ver := range versions {
@ -391,7 +396,8 @@ func BenchmarkEncode_FloatHistograms(b *testing.B) {
-run '^$' -bench '^BenchmarkDecode_FloatHistograms' \
-benchtime 5s -count 6 -cpu 2 -timeout 999m \
| tee decode-fhist.txt
benchstat -col /version decode-fhist.txt
benchstat -col /version decode-fhist.txt
*/
func BenchmarkDecode_FloatHistograms(b *testing.B) {
for _, ver := range versions {

View File

@ -602,7 +602,7 @@ func (d *Decoder) histogramSamplesV2(dec *encoding.Decbuf, histograms []RefHisto
if prev == nil || len(histograms) == 0 {
prev = &RefHistogramSample{
Ref: firstRef,
ST: firstST,
ST: firstST,
}
}
@ -781,7 +781,7 @@ func (d *Decoder) floatHistogramSamplesV2(dec *encoding.Decbuf, histograms []Ref
if prev == nil || len(histograms) == 0 {
prev = &RefFloatHistogramSample{
Ref: firstRef,
ST: firstST,
ST: firstST,
}
}

View File

@ -488,7 +488,6 @@ func TestRecord_MixedRegularAndCustomBucketHistogramPermutations(t *testing.T) {
type tc struct {
name string
kinds []string
stModes []stMode
}
testCases := []tc{

View File

@ -159,9 +159,9 @@ func GenCustomBucketHistograms(n int, stCase HistSTCase) []record.RefHistogramSa
Ref: chunks.HeadSeriesRef(i),
T: 1709000000 + int64(i)*15,
H: &histogram.Histogram{
Count: uint64(10 + i%100),
Sum: float64(100+i) * 1.5,
Schema: histogram.CustomBucketsSchema,
Count: uint64(10 + i%100),
Sum: float64(100+i) * 1.5,
Schema: histogram.CustomBucketsSchema,
PositiveSpans: []histogram.Span{
{Offset: 0, Length: 8},
},