[][src]Struct lognplot::tsdb::Aggregation

pub struct Aggregation<V, M> where
    M: Metrics<V> + From<V>, 
{ pub count: usize, pub timespan: TimeSpan, // some fields omitted }

An aggregation of observations of some type.

Fields

count: usize

Counter of the number of events. TODO: this is duplicated in the specific metrics?

timespan: TimeSpan

The timespan this aggregation is about. This is some bucket of time which groups observed measurements.

Methods

impl<V, M> Aggregation<V, M> where
    M: Metrics<V> + From<V> + Clone
[src]

pub fn new(timespan: TimeSpan, metrics: M, count: usize) -> Self[src]

pub fn from_aggregations(aggregations: &[Aggregation<V, M>]) -> Option<Self>[src]

Merge given aggregations into a single aggregate

pub fn update(&mut self, sample: &Observation<V>)[src]

pub fn include(&mut self, aggregation: &Aggregation<V, M>)[src]

Update aggregation with another aggregation

pub fn metrics(&self) -> &M[src]

Trait Implementations

impl<V, M> From<Observation<V>> for Aggregation<V, M> where
    M: Metrics<V> + From<V> + Clone
[src]

impl<'_, V, M> From<&'_ Aggregation<V, M>> for Aggregation<V, M> where
    M: Metrics<V> + From<V> + Clone
[src]

impl<V: Clone, M: Clone> Clone for Aggregation<V, M> where
    M: Metrics<V> + From<V>, 
[src]

impl<V: Debug, M: Debug> Debug for Aggregation<V, M> where
    M: Metrics<V> + From<V>, 
[src]

Auto Trait Implementations

impl<V, M> Send for Aggregation<V, M> where
    M: Send,
    V: Send

impl<V, M> Sync for Aggregation<V, M> where
    M: Sync,
    V: Sync

impl<V, M> Unpin for Aggregation<V, M> where
    M: Unpin,
    V: Unpin

impl<V, M> UnwindSafe for Aggregation<V, M> where
    M: UnwindSafe,
    V: UnwindSafe

impl<V, M> RefUnwindSafe for Aggregation<V, M> where
    M: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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