Trait glean_core::metrics::MetricType
source · [−]pub trait MetricType {
fn meta(&self) -> &CommonMetricData;
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
fn meta(&self) -> &CommonMetricData
fn meta(&self) -> &CommonMetricData
Access the stored metadata
Provided Methods
Create a new metric from this with a new name.
fn 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.
fn 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.