Class DoubleHistogramPointData
java.lang.Object
io.opentelemetry.sdk.metrics.data.DoubleHistogramPointData
- All Implemented Interfaces:
PointData
DoubleHistogramPointData represents an approximate representation of the distribution of
measurements.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleHistogramPointDatacreate(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Attributes attributes, double sum, List<Double> boundaries, List<Long> counts) Creates a DoubleHistogramPointData.static DoubleHistogramPointDatacreate(long startEpochNanos, long epochNanos, io.opentelemetry.api.common.Attributes attributes, double sum, List<Double> boundaries, List<Long> counts, List<ExemplarData> exemplars) Creates a DoubleHistogramPointData.The bucket boundaries.doublegetBucketLowerBound(int bucketIndex) Returns the lower bound of a bucket (all values would have been greater than).doublegetBucketUpperBound(int bucketIndex) Returns the upper inclusive bound of a bucket (all values would have been less then or equal).abstract longgetCount()The number of measurements taken.The counts in each bucket.abstract doublegetSum()The sum of all measurements recorded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.metrics.data.PointData
getAttributes, getEpochNanos, getExemplars, getStartEpochNanos
-
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
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
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 matchgetCounts()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 matchgetCounts()index.
-