Trait glean_core::metrics::MetricType
source · pub trait MetricType {
// Required method
fn meta(&self) -> &CommonMetricDataInternal;
// Provided methods
fn with_name(&self, _name: String) -> Self
where Self: Sized { ... }
fn with_dynamic_label(&self, _label: String) -> Self
where Self: Sized { ... }
fn should_record(&self, glean: &Glean) -> bool { ... }
}
Expand description
A MetricType
describes common behavior across all metrics.
Required Methods§
Provided Methods§
sourcefn with_name(&self, _name: String) -> Selfwhere
Self: Sized,
fn with_name(&self, _name: String) -> Selfwhere
Self: Sized,
Create a new metric from this with a new name.
sourcefn with_dynamic_label(&self, _label: String) -> Selfwhere
Self: Sized,
fn with_dynamic_label(&self, _label: String) -> Selfwhere
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
This depends on the metrics own state, as determined by its metadata, and whether upload is enabled on the Glean object.