pub type DistributionValue = SmallVec<[DistributionType; 3]>;
Expand description

A distribution of values within a Bucket.

Distributions logically store a histogram of values. Based on individual reported values, distributions allow to query the maximum, minimum, or average of the reported values, as well as statistical quantiles.

§Example

use relay_metrics::dist;

let mut dist = dist![1, 1, 1, 2];
dist.push(5.into());
dist.extend(std::iter::repeat(3.into()).take(7));

Logically, this distribution is equivalent to this visualization:

value | count
1.0   | ***
2.0   | *
3.0   | *******
4.0   |
5.0   | *

§Serialization

Distributions serialize as lists of floating point values. The list contains one entry for each value in the distribution, including duplicates.

Aliased Type§

struct DistributionValue { /* private fields */ }