public final class DistributionAggregation extends Object
A distribution contains summary statistics for a population of values and, optionally, a
histogram representing the distribution of those values across a specified set of histogram
buckets, as defined in DistributionAggregationDescriptor.getBucketBoundaries().
Although not forbidden, it is generally a bad idea to include non-finite values (infinities
or NaNs) in the population of values, as this will render the mean meaningless.
| Modifier and Type | Class and Description |
|---|---|
static class |
DistributionAggregation.Range
Describes a range of population values.
|
| Modifier and Type | Method and Description |
|---|---|
static DistributionAggregation |
create(long count,
double mean,
double sum,
DistributionAggregation.Range range,
List<Tag> tags)
Constructs a new
DistributionAggregation. |
static DistributionAggregation |
create(long count,
double mean,
double sum,
DistributionAggregation.Range range,
List<Tag> tags,
List<Long> bucketCounts)
Constructs a new
DistributionAggregation with the optional bucketCounts. |
List<Long> |
getBucketCounts()
A Distribution may optionally contain a histogram of the values in the population.
|
long |
getCount()
The number of values in the population.
|
double |
getMean()
The arithmetic mean of the values in the population.
|
DistributionAggregation.Range |
getRange()
The range of the population values.
|
double |
getSum()
The sum of the values in the population.
|
List<Tag> |
getTags()
Tags associated with this DistributionAggregation. |
public static final DistributionAggregation create(long count, double mean, double sum, DistributionAggregation.Range range, List<Tag> tags)
DistributionAggregation.public static final DistributionAggregation create(long count, double mean, double sum, DistributionAggregation.Range range, List<Tag> tags, List<Long> bucketCounts)
DistributionAggregation with the optional bucketCounts.public final List<Tag> getTags()
Tags associated with this DistributionAggregation.
Note: The returned list is unmodifiable, attempts to update it will throw an UnsupportedOperationException.
public long getCount()
public double getMean()
getCount() is zero then this
value must also be zero.public double getSum()
getCount() is zero then this values must
also be zero.public DistributionAggregation.Range getRange()
getCount() is zero then this returned range is
implementation-dependent.@Nullable public List<Long> getBucketCounts()
getBucketCounts() as counts of values that fall into one of a
sequence of non-overlapping buckets, described by
DistributionAggregationDescriptor.getBucketBoundaries().
The sum of the values in getBucketCounts() must equal the value in
getCount().
Bucket counts are given in order under the numbering scheme described above (the underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; the overflow bucket has number N-1).
The size of getBucketCounts() must be no greater than N as defined in
DistributionAggregationDescriptor.getBucketBoundaries().
Any suffix of trailing buckets containing only zero may be omitted.
getBucketCounts() will return null iff the associated
DistributionAggregationDescriptor.getBucketBoundaries() returns null.