[][src]Enum metrix::Observation

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: Lcount: u64timestamp: Instant
ObservedOne

Observed one occurrence at the given timestamp

Fields of ObservedOne

label: Ltimestamp: Instant
ObservedOneValue

Observed one occurence with a value at a given timestamp.

Fields of ObservedOneValue

label: Lvalue: u64timestamp: Instant

Methods

impl<L> Observation<L> where
    L: Clone
[src]

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]

pub fn timestamp(&self) -> Instant
[src]

Trait Implementations

impl<L> ObservationLike for Observation<L>
[src]

impl<T> From<Observation<T>> for LabelAndUpdate<T>
[src]

impl<'a, T> From<&'a Observation<T>> for BorrowedLabelAndUpdate<'a, T>
[src]

impl<L: Clone> Clone for Observation<L>
[src]

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

impl<L> Sync for Observation<L> where
    L: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T