Struct stats_traits::field_stat_types::FieldStat
source · pub struct FieldStat<TStatType: 'static> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl Counter for FieldStat<BoxLocalCounter>
impl Counter for FieldStat<BoxLocalCounter>
source§fn increment_value(&self, value: i64)
fn increment_value(&self, value: i64)
Increments the counter by the given amount.
source§impl Histogram for FieldStat<BoxLocalHistogram>
impl Histogram for FieldStat<BoxLocalHistogram>
source§fn add_value(&self, value: i64)
fn add_value(&self, value: i64)
Adds value to the histogram. It is being aggregated based on ExportType
source§fn add_repeated_value(&self, value: i64, nsamples: u32)
fn add_repeated_value(&self, value: i64, nsamples: u32)
You might want to call this method when you have a very hot counter to avoid some
congestions on it. The default implementation simply calls add_value O(nsamples) times.
If you have a performance-sensitive use case, check whether your Stats type has an O(1)
implementation.
Value is the value of a single samples and nsamples is the number of samples.
Please notice that difference in the value semantic compared to
Timeseries::add_value_aggregated
.source§impl Timeseries for FieldStat<BoxLocalTimeseries>
impl Timeseries for FieldStat<BoxLocalTimeseries>
source§fn add_value(&self, value: i64)
fn add_value(&self, value: i64)
Adds value to the timeseries. It is being aggregated based on ExportType
source§fn add_value_aggregated(&self, value: i64, nsamples: u32)
fn add_value_aggregated(&self, value: i64, nsamples: u32)
You might want to call this method when you have a very hot counter to avoid some
congestions on it.
Value is the sum of values of the samples and nsamples is the number of samples.
Please notice that difference in the value semantic compared to
Histogram::add_repeated_value
.Auto Trait Implementations§
impl<TStatType> RefUnwindSafe for FieldStat<TStatType>
impl<TStatType> Send for FieldStat<TStatType>
impl<TStatType> Sync for FieldStat<TStatType>
impl<TStatType> Unpin for FieldStat<TStatType>
impl<TStatType> UnwindSafe for FieldStat<TStatType>
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
Mutably borrows from an owned value. Read more