Enum opentelemetry_sdk::metrics::Aggregation
source · #[non_exhaustive]pub enum Aggregation {
Drop,
Default,
Sum,
LastValue,
ExplicitBucketHistogram {
boundaries: Vec<f64>,
record_min_max: bool,
},
Base2ExponentialHistogram {
max_size: u32,
max_scale: i8,
record_min_max: bool,
},
}
Expand description
The way recorded measurements are summarized.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Drop
An aggregation that drops all recorded data.
Default
An aggregation that uses the default instrument kind selection mapping to select another aggregation.
A metric reader can be configured to make an aggregation selection based on instrument kind that differs from the default. This aggregation ensures the default is used.
See the DefaultAggregationSelector for information about the default instrument kind selection mapping.
Sum
An aggregation that summarizes a set of measurements as their arithmetic sum.
LastValue
An aggregation that summarizes a set of measurements as the last one made.
ExplicitBucketHistogram
An aggregation that summarizes a set of measurements as a histogram with explicitly defined buckets.
Fields
boundaries: Vec<f64>
The increasing bucket boundary values.
Boundary values define bucket upper bounds. Buckets are exclusive of their lower boundary and inclusive of their upper bound (except at positive infinity). A measurement is defined to fall into the greatest-numbered bucket with a boundary that is greater than or equal to the measurement. As an example, boundaries defined as:
vec![0.0, 5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 250.0, 500.0, 750.0, 1000.0, 2500.0, 5000.0, 7500.0, 10000.0];
Will define these buckets:
(-∞, 0], (0, 5.0], (5.0, 10.0], (10.0, 25.0], (25.0, 50.0], (50.0, 75.0], (75.0, 100.0], (100.0, 250.0], (250.0, 500.0], (500.0, 750.0], (750.0, 1000.0], (1000.0, 2500.0], (2500.0, 5000.0], (5000.0, 7500.0], (7500.0, 10000.0], (10000.0, +∞)
record_min_max: bool
Indicates whether to not record the min and max of the distribution.
By default, these values are recorded.
Recording these values for cumulative data is expected to have little
value, they will represent the entire life of the instrument instead of
just the current collection cycle. It is recommended to set this to
false
for that type of data to avoid computing the low-value
instances.
Base2ExponentialHistogram
An aggregation that summarizes a set of measurements as a histogram with bucket widths that grow exponentially.
Fields
max_scale: i8
The maximum resolution scale to use for the histogram.
The maximum value is 20
, in which case the maximum number of buckets
that can fit within the range of a signed 32-bit integer index could be
used.
The minimum value is -10
in which case only two buckets will be used.
record_min_max: bool
Indicates whether to not record the min and max of the distribution.
By default, these values are recorded.
It is generally not valuable to record min and max for cumulative data
as they will represent the entire life of the instrument instead of just
the current collection cycle, you can opt out by setting this value to
false
Implementations§
Trait Implementations§
source§impl Clone for Aggregation
impl Clone for Aggregation
source§fn clone(&self) -> Aggregation
fn clone(&self) -> Aggregation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Aggregation
impl Debug for Aggregation
source§impl Display for Aggregation
impl Display for Aggregation
source§impl PartialEq for Aggregation
impl PartialEq for Aggregation
impl StructuralPartialEq for Aggregation
Auto Trait Implementations§
impl Freeze for Aggregation
impl RefUnwindSafe for Aggregation
impl Send for Aggregation
impl Sync for Aggregation
impl Unpin for Aggregation
impl UnwindSafe for Aggregation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)