Package io.opencensus.metrics.export
Class Distribution
- java.lang.Object
-
- io.opencensus.metrics.export.Distribution
-
- Direct Known Subclasses:
AutoValue_Distribution
@ExperimentalApi @Immutable public abstract class Distribution extends java.lang.Object
Distribution
contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.- Since:
- 0.17
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Distribution.Bucket
The histogram bucket of the population values.static class
Distribution.BucketOptions
The bucket options used to create a histogram for the distribution.
-
Constructor Summary
Constructors Constructor Description Distribution()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Distribution
create(long count, double sum, double sumOfSquaredDeviations, Distribution.BucketOptions bucketOptions, java.util.List<Distribution.Bucket> buckets)
Creates aDistribution
.abstract Distribution.BucketOptions
getBucketOptions()
Returns bucket options used to create a histogram for the distribution.abstract java.util.List<Distribution.Bucket>
getBuckets()
Returns the aggregated histogramDistribution.Bucket
s.abstract long
getCount()
Returns the aggregated count.abstract double
getSum()
Returns the aggregated sum.abstract double
getSumOfSquaredDeviations()
Returns the aggregated sum of squared deviations.
-
-
-
Method Detail
-
create
public static Distribution create(long count, double sum, double sumOfSquaredDeviations, Distribution.BucketOptions bucketOptions, java.util.List<Distribution.Bucket> buckets)
Creates aDistribution
.- Parameters:
count
- the count of the population values.sum
- the sum of the population values.sumOfSquaredDeviations
- the sum of squared deviations of the population values.bucketOptions
- the bucket options used to create a histogram for the distribution.buckets
-Distribution.Bucket
s of a histogram.- Returns:
- a
Distribution
. - Since:
- 0.17
-
getCount
public abstract long getCount()
Returns the aggregated count.- Returns:
- the aggregated count.
- Since:
- 0.17
-
getSum
public abstract double getSum()
Returns the aggregated sum.- Returns:
- the aggregated sum.
- Since:
- 0.17
-
getSumOfSquaredDeviations
public abstract double getSumOfSquaredDeviations()
Returns the aggregated sum of squared deviations.The sum of squared deviations from the mean of the values in the population. For values x_i this is:
Sum[i=1..n]((x_i - mean)^2)
If count is zero then this field must be zero.
- Returns:
- the aggregated sum of squared deviations.
- Since:
- 0.17
-
getBucketOptions
@Nullable public abstract Distribution.BucketOptions getBucketOptions()
Returns bucket options used to create a histogram for the distribution.- Returns:
- the
BucketOptions
associated with theDistribution
, ornull
if there isn't one. - Since:
- 0.17
-
getBuckets
public abstract java.util.List<Distribution.Bucket> getBuckets()
Returns the aggregated histogramDistribution.Bucket
s.- Returns:
- the aggregated histogram buckets.
- Since:
- 0.17
-
-