Class ExplicitBucketHistogramUtils
java.lang.Object
io.opentelemetry.sdk.metrics.internal.aggregator.ExplicitBucketHistogramUtils
Utilities for interacting with explicit bucket histograms.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
createBoundaryArray
(List<Double> boundaries) Converts bucket boundary "convenient" configuration into the "more efficient" array.static int
findBucketIndex
(double[] boundaries, double value) Finds the bucket index for a histogram.static void
validateBucketBoundaries
(List<Double> boundaries) Validates errors in boundary configuration.
-
Field Details
-
DEFAULT_HISTOGRAM_BUCKET_BOUNDARIES
-
-
Constructor Details
-
ExplicitBucketHistogramUtils
private ExplicitBucketHistogramUtils()
-
-
Method Details
-
createBoundaryArray
Converts bucket boundary "convenient" configuration into the "more efficient" array. -
findBucketIndex
public static int findBucketIndex(double[] boundaries, double value) Finds the bucket index for a histogram.- Parameters:
boundaries
- the array of bucket boundaries.value
- The current measurement value- Returns:
- The bucket index where the value should be recorded.
-
validateBucketBoundaries
Validates errors in boundary configuration.- Parameters:
boundaries
- The array of bucket boundaries.- Throws:
IllegalArgumentException
- if boundaries are not specified correctly.
-