pub struct MetricTemplate {
pub selectors: Vec<String>,
pub metric_id: MetricId,
pub metric_type: MetricType,
pub event_codes: Vec<EventCode>,
pub upload_once: bool,
pub project_id: Option<ProjectId>,
}
Expand description
Configuration for a single FIRE metric template to map from an Inspect property to a cobalt metric. Unlike MetricConfig, selectors aren’t parsed.
Fields§
§selectors: Vec<String>
Selector identifying the metric to sample via the diagnostics platform.
metric_id: MetricId
Cobalt metric id to map the selector to.
metric_type: MetricType
Data type to transform the metric to.
event_codes: Vec<EventCode>
Event codes defining the dimensions of the cobalt metric. Notes:
- Order matters, and must match the order of the defined dimensions in the cobalt metric file.
- The FIRE component-ID will be inserted as the first element of event_codes.
- The event_codes field may be omitted from the config file if component-ID is the only event code.
upload_once: bool
Optional boolean specifying whether to upload the specified metric only once, the first time it becomes available to the sampler. Defaults to false.
project_id: Option<ProjectId>
Optional project id. When present this project id will be used instead of the top-level project id.
Trait Implementations§
Source§impl Clone for MetricTemplate
impl Clone for MetricTemplate
Source§fn clone(&self) -> MetricTemplate
fn clone(&self) -> MetricTemplate
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MetricTemplate
impl Debug for MetricTemplate
Source§impl<'de> Deserialize<'de> for MetricTemplate
impl<'de> Deserialize<'de> for MetricTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MetricTemplate
impl PartialEq for MetricTemplate
Source§impl Serialize for MetricTemplate
impl Serialize for MetricTemplate
impl Eq for MetricTemplate
impl StructuralPartialEq for MetricTemplate
Auto Trait Implementations§
impl Freeze for MetricTemplate
impl RefUnwindSafe for MetricTemplate
impl Send for MetricTemplate
impl Sync for MetricTemplate
impl Unpin for MetricTemplate
impl UnwindSafe for MetricTemplate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more