Struct glean_core::metrics::DenominatorMetric
source · [−]pub struct DenominatorMetric { /* private fields */ }
Expand description
A Denominator metric (a kind of count shared among Rate metrics).
Used to count things. The value can only be incremented, not decremented.
Implementations
sourceimpl DenominatorMetric
impl DenominatorMetric
sourcepub fn new(meta: CommonMetricData, numerators: Vec<CommonMetricData>) -> Self
pub fn new(meta: CommonMetricData, numerators: Vec<CommonMetricData>) -> Self
Creates a new denominator metric.
sourcepub fn test_get_value(&self, ping_name: Option<String>) -> Option<i32>
pub fn test_get_value(&self, ping_name: Option<String>) -> Option<i32>
Test-only API (exported for FFI purposes).
Gets the currently stored value as an integer.
This doesn’t clear the stored value.
Trait Implementations
sourceimpl Clone for DenominatorMetric
impl Clone for DenominatorMetric
sourcefn clone(&self) -> DenominatorMetric
fn clone(&self) -> DenominatorMetric
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for DenominatorMetric
impl Debug for DenominatorMetric
sourceimpl MetricType for DenominatorMetric
impl MetricType for DenominatorMetric
sourcefn meta(&self) -> &CommonMetricData
fn meta(&self) -> &CommonMetricData
Access the stored metadata
sourcefn with_name(&self, _name: String) -> Self where
Self: Sized,
fn with_name(&self, _name: String) -> Self where
Self: Sized,
Create a new metric from this with a new name.
sourcefn with_dynamic_label(&self, _label: String) -> Self where
Self: Sized,
fn with_dynamic_label(&self, _label: String) -> Self where
Self: Sized,
Create a new metric from this with a specific label.
sourcefn should_record(&self, glean: &Glean) -> bool
fn should_record(&self, glean: &Glean) -> bool
Whether this metric should currently be recorded Read more
Auto Trait Implementations
impl RefUnwindSafe for DenominatorMetric
impl Send for DenominatorMetric
impl Sync for DenominatorMetric
impl Unpin for DenominatorMetric
impl UnwindSafe for DenominatorMetric
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more