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: DynamicLabelType) -> 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: DynamicLabelType) -> Selfwhere
Self: Sized,
fn with_dynamic_label(&self, _label: DynamicLabelType) -> 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.