pub struct Meter { /* private fields */ }Expand description
A compound stat that includes a rate metric and a cumulative total metric.
Implementations§
Source§impl Meter
impl Meter
Sourcepub fn new(rate_metric_name: MetricName, total_metric_name: MetricName) -> Self
pub fn new(rate_metric_name: MetricName, total_metric_name: MetricName) -> Self
Construct a Meter with seconds as time unit, backed by a WindowedSum.
Sourcepub fn with_unit(
unit: TimeUnit,
rate_metric_name: MetricName,
total_metric_name: MetricName,
) -> Self
pub fn with_unit( unit: TimeUnit, rate_metric_name: MetricName, total_metric_name: MetricName, ) -> Self
Construct a Meter with the provided time unit, backed by a WindowedSum.
Sourcepub fn with_rate_stat(
rate_stat: Arc<SampledStat>,
rate_metric_name: MetricName,
total_metric_name: MetricName,
) -> Self
pub fn with_rate_stat( rate_stat: Arc<SampledStat>, rate_metric_name: MetricName, total_metric_name: MetricName, ) -> Self
Construct a Meter with seconds as time unit and a provided rate stat.
Sourcepub fn with_unit_rate_stat(
unit: TimeUnit,
rate_stat: Arc<SampledStat>,
rate_metric_name: MetricName,
total_metric_name: MetricName,
) -> Self
pub fn with_unit_rate_stat( unit: TimeUnit, rate_stat: Arc<SampledStat>, rate_metric_name: MetricName, total_metric_name: MetricName, ) -> Self
Construct a Meter with the provided time unit and rate stat.
Panics if rate_stat is not a WindowedSum/WindowedCount, mirroring
Java’s IllegalArgumentException — this is a construction-time
programming error (Meter is only meaningful with a windowed sum/count).
Trait Implementations§
Source§impl CompoundStat for Meter
impl CompoundStat for Meter
Source§fn stats(&self) -> Vec<NamedMeasurable>
fn stats(&self) -> Vec<NamedMeasurable>
The named measurable child metrics this compound stat exposes.
Auto Trait Implementations§
impl Freeze for Meter
impl !RefUnwindSafe for Meter
impl Send for Meter
impl Sync for Meter
impl Unpin for Meter
impl UnsafeUnpin for Meter
impl !UnwindSafe for Meter
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