Package io.opentelemetry.sdk.metrics
Class Base2ExponentialHistogramOptions.Builder
java.lang.Object
io.opentelemetry.sdk.metrics.Base2ExponentialHistogramOptions.Builder
- Enclosing class:
Base2ExponentialHistogramOptions
Builder for
Base2ExponentialHistogramOptions.- Since:
- 1.60.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newBase2ExponentialHistogramOptionswith the configuration of this builder.setMaxBuckets(int maxBuckets) Sets the max number of positive buckets and negative buckets (max total buckets is 2 *maxBuckets+ 1 zero bucket).setMaxScale(int maxScale) Sets the maximum and initial scale.setRecordMinMax(boolean recordMinMax) Sets whether min and max values should be recorded.
-
Method Details
-
setMaxBuckets
Sets the max number of positive buckets and negative buckets (max total buckets is 2 *maxBuckets+ 1 zero bucket).- Parameters:
maxBuckets- the maximum number of buckets
-
setMaxScale
Sets the maximum and initial scale. If measurements can't fit in a particular scale given themaxBuckets, the scale is reduced until the measurements can be accommodated. Setting maxScale may reduce the number of downscales. Additionally, the performance of computing bucket index is improved when scale is<= 0.- Parameters:
maxScale- the maximum scale
-
setRecordMinMax
Sets whether min and max values should be recorded.- Parameters:
recordMinMax- whether to record min and max values
-
build
Returns a newBase2ExponentialHistogramOptionswith the configuration of this builder.- Throws:
IllegalArgumentException- ifmaxBucketsis less than 2, or ifmaxScaleis not between -10 and 20 (inclusive).
-