We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e422e9a commit 5296dd2Copy full SHA for 5296dd2
staging/src/k8s.io/component-base/metrics/testutil/metrics.go
@@ -286,8 +286,14 @@ func (hist *Histogram) Quantile(q float64) float64 {
286
})
287
}
288
289
- // bucketQuantile expects the upper bound of the last bucket to be +inf
290
- // buckets[len(buckets)-1].upperBound = math.Inf(+1)
+ if len(buckets) == 0 || buckets[len(buckets)-1].upperBound != math.Inf(+1) {
+ // The list of buckets in dto.Histogram doesn't include the final +Inf bucket, so we
291
+ // add it here for the reset of the samples.
292
+ buckets = append(buckets, bucket{
293
+ count: float64(hist.GetSampleCount()),
294
+ upperBound: math.Inf(+1),
295
+ })
296
+ }
297
298
return bucketQuantile(q, buckets)
299
0 commit comments