Class DoubleHistogramPointData

java.lang.Object
io.opentelemetry.sdk.metrics.data.DoubleHistogramPointData
All Implemented Interfaces:
PointData

@Immutable public abstract class DoubleHistogramPointData extends Object implements PointData
DoubleHistogramPointData represents an approximate representation of the distribution of measurements.
  • Method Details

    • create

      public static DoubleHistogramPointData create(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Attributes attributes, double sum, List<Double> boundaries, List<Long> counts)
      Creates a DoubleHistogramPointData. For a Histogram with N defined boundaries, there should be N+1 counts.
      Returns:
      a DoubleHistogramPointData.
      Throws:
      IllegalArgumentException - if the given boundaries/counts were invalid
    • create

      public static DoubleHistogramPointData create(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Attributes attributes, double sum, List<Double> boundaries, List<Long> counts, List<ExemplarData> exemplars)
      Creates a DoubleHistogramPointData. For a Histogram with N defined boundaries, there should be N+1 counts.
      Returns:
      a DoubleHistogramPointData.
      Throws:
      IllegalArgumentException - if the given boundaries/counts were invalid
    • getSum

      public abstract double getSum()
      The sum of all measurements recorded.
      Returns:
      the sum of recorded measurements.
    • getCount

      public abstract long getCount()
      The number of measurements taken.
      Returns:
      the count of recorded measurements.
    • getBoundaries

      public abstract List<Double> getBoundaries()
      The bucket boundaries. For a Histogram with N defined boundaries, e.g, [x, y, z]. There are N+1 counts: (-inf, x], (x, y], (y, z], (z, +inf).
      Returns:
      the read-only bucket boundaries in increasing order. do not mutate the returned object.
    • getCounts

      public abstract List<Long> getCounts()
      The counts in each bucket.
      Returns:
      the read-only counts in each bucket. do not mutate the returned object.
    • getBucketLowerBound

      public double getBucketLowerBound(int bucketIndex)
      Returns the lower bound of a bucket (all values would have been greater than).
      Parameters:
      bucketIndex - The bucket index, should match getCounts() index.
    • getBucketUpperBound

      public double getBucketUpperBound(int bucketIndex)
      Returns the upper inclusive bound of a bucket (all values would have been less then or equal).
      Parameters:
      bucketIndex - The bucket index, should match getCounts() index.