Class ExplicitBucketHistogramUtils


  • public final class ExplicitBucketHistogramUtils
    extends java.lang.Object
    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.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double[] createBoundaryArray​(java.util.List<java.lang.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​(java.util.List<java.lang.Double> boundaries)
      Validates errors in boundary configuration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_HISTOGRAM_BUCKET_BOUNDARIES

        public static final java.util.List<java.lang.Double> DEFAULT_HISTOGRAM_BUCKET_BOUNDARIES
    • Constructor Detail

      • ExplicitBucketHistogramUtils

        private ExplicitBucketHistogramUtils()
    • Method Detail

      • createBoundaryArray

        public static double[] createBoundaryArray​(java.util.List<java.lang.Double> boundaries)
        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

        public static void validateBucketBoundaries​(java.util.List<java.lang.Double> boundaries)
        Validates errors in boundary configuration.
        Parameters:
        boundaries - The array of bucket boundaries.
        Throws:
        java.lang.IllegalArgumentException - if boundaries are not specified correctly.