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

Fields

§label: L
§count: u64
§timestamp: Instant

Observed many occurances at th given timestamp

§

ObservedOne

Fields

§label: L
§timestamp: Instant

Observed one occurrence at the given timestamp

§

ObservedOneValue

Fields

§label: L
§value: u64
§timestamp: Instant

Observed one occurence with a value at a given timestamp.

Implementations§

Extracts the label L from an observation.

Scale by the given ValueScaling

This will clone the Observation

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.