Skip to content

Commit 827feb2

Browse files
committed
add: bench for Inf+ use case
Signed-off-by: Ivan Goncharov <[email protected]>
1 parent 3e49d04 commit 827feb2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

prometheus/histogram_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,3 +1486,16 @@ func BenchmarkFindBucketLarge(b *testing.B) {
14861486
func BenchmarkFindBucketHuge(b *testing.B) {
14871487
benchmarkFindBucket(b, 500)
14881488
}
1489+
1490+
func BenchmarkFindBucketNone(b *testing.B) {
1491+
h := &histogram{upperBounds: make([]float64, 500)}
1492+
for i := range h.upperBounds {
1493+
h.upperBounds[i] = float64(i)
1494+
}
1495+
v := 1000.5
1496+
1497+
b.ResetTimer()
1498+
for i := 0; i < b.N; i++ {
1499+
resultFindBucket = h.findBucket(v)
1500+
}
1501+
}

0 commit comments

Comments
 (0)