Struct glean_core::metrics::RateMetric [−][src]
pub struct RateMetric { /* fields omitted */ }
Expand description
A rate metric.
Used to determine the proportion of things via two counts:
- A numerator defining the amount of times something happened,
- A denominator counting the amount of times someting could have happened.
Both numerator and denominator can only be incremented, not decremented.
Implementations
impl RateMetric
[src]
impl RateMetric
[src]pub fn new(meta: CommonMetricData) -> Self
[src]
pub fn new(meta: CommonMetricData) -> Self
[src]Creates a new rate metric.
pub fn add_to_numerator(&self, glean: &Glean, amount: i32)
[src]
pub fn add_to_numerator(&self, glean: &Glean, amount: i32)
[src]pub fn add_to_denominator(&self, glean: &Glean, amount: i32)
[src]
pub fn add_to_denominator(&self, glean: &Glean, amount: i32)
[src]Trait Implementations
impl Clone for RateMetric
[src]
impl Clone for RateMetric
[src]fn clone(&self) -> RateMetric
[src]
fn clone(&self) -> RateMetric
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for RateMetric
[src]
impl Debug for RateMetric
[src]impl MetricType for RateMetric
[src]
impl MetricType for RateMetric
[src]fn meta(&self) -> &CommonMetricData
[src]
fn meta(&self) -> &CommonMetricData
[src]Access the stored metadata
fn meta_mut(&mut self) -> &mut CommonMetricData
[src]
fn meta_mut(&mut self) -> &mut CommonMetricData
[src]Access the stored metadata mutable
fn should_record(&self, glean: &Glean) -> bool
[src]
fn should_record(&self, glean: &Glean) -> bool
[src]Whether this metric should currently be recorded Read more
Auto Trait Implementations
impl RefUnwindSafe for RateMetric
impl Send for RateMetric
impl Sync for RateMetric
impl Unpin for RateMetric
impl UnwindSafe for RateMetric
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more