(cherry picked from commit 65e56c9fb8)
Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
1 parent
173bce8658
commit
24f22fd4c2
3 files changed
+28
-5
No files matched your search
@@ -597,7 +597,12 @@ func calcBucketBound(bucketOptions cloudMonitoringBucketOptions, n int) string {
|
||||
case bucketOptions.ExponentialBuckets != nil:
|
||||
bucketBound = strconv.FormatInt(int64(bucketOptions.ExponentialBuckets.Scale*math.Pow(bucketOptions.ExponentialBuckets.GrowthFactor, float64(n-1))), 10)
|
||||
case bucketOptions.ExplicitBuckets != nil:
|
||||
bucketBound = fmt.Sprintf("%g", bucketOptions.ExplicitBuckets.Bounds[n])
|
||||
if n < len(bucketOptions.ExplicitBuckets.Bounds) {
|
||||
bucketBound = fmt.Sprintf("%g", bucketOptions.ExplicitBuckets.Bounds[n])
|
||||
} else {
|
||||
lastBound := bucketOptions.ExplicitBuckets.Bounds[len(bucketOptions.ExplicitBuckets.Bounds)-1]
|
||||
bucketBound = fmt.Sprintf("%g+", lastBound)
|
||||
}
|
||||
}
|
||||
return bucketBound
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user