Enum metrix::Observation
source · pub enum Observation<L> {
Observed {
label: L,
count: u64,
timestamp: Instant,
},
ObservedOne {
label: L,
timestamp: Instant,
},
ObservedOneValue {
label: L,
value: u64,
timestamp: Instant,
},
}
Expand description
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
ObservedOne
Observed one occurrence at the given timestamp
ObservedOneValue
Observed one occurence with a value at a given timestamp.
Implementations§
source§impl<L> Observation<L>where
L: Clone,
impl<L> Observation<L>where
L: Clone,
sourcepub fn scaled(&self, scaling: ValueScaling) -> Observation<L>
pub fn scaled(&self, scaling: ValueScaling) -> Observation<L>
Scale by the given ValueScaling
This will clone the Observation
Trait Implementations§
source§impl<L: Clone> Clone for Observation<L>
impl<L: Clone> Clone for Observation<L>
source§fn clone(&self) -> Observation<L>
fn clone(&self) -> Observation<L>
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<'a, T> From<&'a Observation<T>> for BorrowedLabelAndUpdate<'a, T>
impl<'a, T> From<&'a Observation<T>> for BorrowedLabelAndUpdate<'a, T>
source§fn from(obs: &'a Observation<T>) -> BorrowedLabelAndUpdate<'a, T>
fn from(obs: &'a Observation<T>) -> BorrowedLabelAndUpdate<'a, T>
Converts to this type from the input type.
source§impl<T> From<Observation<T>> for LabelAndUpdate<T>
impl<T> From<Observation<T>> for LabelAndUpdate<T>
source§fn from(obs: Observation<T>) -> LabelAndUpdate<T>
fn from(obs: Observation<T>) -> LabelAndUpdate<T>
Converts to this type from the input type.