diff --git a/output/cloud/expv2/hdr_test.go b/output/cloud/expv2/hdr_test.go index df84d8431420..129a7a24783c 100644 --- a/output/cloud/expv2/hdr_test.go +++ b/output/cloud/expv2/hdr_test.go @@ -225,7 +225,27 @@ func TestHistogramAddWithMultipleNegativeNums(t *testing.T) { assert.Equal(t, exp, h) } -func TestNewHistoramWithNoVals(t *testing.T) { +func TestHistogramAddWithZeroToOneValues(t *testing.T) { + t.Parallel() + h := newHistogram() + for _, v := range []float64{0.000052, 0.002115, 0.012013, 0.05017, 0.250, 0.54, 0.541, 0.803} { + h.Add(v) + } + + exp := &histogram{ + Buckets: map[uint32]uint32{1: 1, 3: 1, 13: 1, 51: 1, 250: 1, 391: 2, 456: 1}, + ExtraLowBucket: 0, + ExtraHighBucket: 0, + Max: .803, + Min: .000052, + Sum: 2.19835, + Count: 8, + MinimumResolution: .001, + } + assert.Equal(t, exp, h) +} + +func TestNewHistoram(t *testing.T) { t.Parallel() h := newHistogram()