Enum metrix::Observation
[−]
[src]
pub enum Observation<L> { Observed { label: L, count: u64, timestamp: Instant, }, ObservedOne { label: L, timestamp: Instant, }, ObservedOneValue { label: L, value: u64, timestamp: Instant, }, }
An observation that has been made.
Be aware that not all instruments handle all
observations or values.
E.g. a Meter
does not take the value
of
an Observation::ObservedOneValue
into account but
simply counts the observation as one occurence.
Variants
Observed
Observed many occurances at th given timestamp
Fields of Observed
label: L | |
count: u64 | |
timestamp: Instant |
ObservedOne
Observed one occurrence at the given timestamp
Fields of ObservedOne
label: L | |
timestamp: Instant |
ObservedOneValue
Observed one occurence with a value at a given timestamp.
Fields of ObservedOneValue
label: L | |
value: u64 | |
timestamp: Instant |
Methods
impl<L> Observation<L> where
L: Clone,
[src]
L: Clone,
pub fn label(&self) -> &L
[src]
Extracts the label L
from an observation.
pub fn scaled(&self, scaling: ValueScaling) -> Observation<L>
[src]
Scale by the given ValueScaling
This will clone the Observation
impl<L> Observation<L>
[src]
Trait Implementations
impl<T> From<Observation<T>> for LabelAndUpdate<T>
[src]
fn from(obs: Observation<T>) -> LabelAndUpdate<T>
[src]
Performs the conversion.
impl<L: Clone> Clone for Observation<L>
[src]
fn clone(&self) -> Observation<L>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<L> Send for Observation<L> where
L: Send,
L: Send,
impl<L> Sync for Observation<L> where
L: Sync,
L: Sync,