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.
§Arguments
rate_metric_name- the name of the rate metrictotal_metric_name- the name of the cumulative total metric
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.
§Arguments
unit- the time unit of the raterate_metric_name- the name of the rate metrictotal_metric_name- the name of the cumulative total metric
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
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 provided time unit.
§Arguments
unit- the time unit of the raterate_stat- the sampled stat of the rate, aWindowedSumorWindowedCountrate_metric_name- the name of the rate metrictotal_metric_name- the name of the cumulative total metric
§Panics
If rate_stat is not a WindowedSum or WindowedCount, with the
message of Java’s IllegalArgumentException: a construction-time
programming error.
Trait Implementations§
Source§impl CompoundStat for Meter
impl CompoundStat for Meter
Source§fn stats(&self) -> Vec<NamedMeasurable>
fn stats(&self) -> Vec<NamedMeasurable>
Returns 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