[][src]Struct lognplot::tsdb::SampleMetrics

pub struct SampleMetrics {
    pub min: f64,
    pub max: f64,
    pub sum: f64,
    pub sum_squared: f64,
    pub count: usize,
}

Metrics collected about a certain trace This can be used during query.

Fields

min: f64

The minimum value of all samples

max: f64

The maximum value of all samples

sum: f64

The sum of all values. Together with the count, this allows to calculate the average value.

sum_squared: f64

This value allows for calculation of the variance of the signal. TODO: this value will be insanely large at some point in time.

count: usize

The total number of samples

Methods

impl SampleMetrics[src]

pub fn new(min: f64, max: f64, sum: f64, sum_squared: f64, count: usize) -> Self[src]

pub fn mean(&self) -> f64[src]

Calculate the mean value of this metrics.

Trait Implementations

impl Metrics<Sample> for SampleMetrics[src]

fn update(&mut self, sample: &Sample)[src]

Integrate a single sample into tha metrics. This involves updating the min and max values as well as the count and the sum.

fn include(&mut self, metrics: &SampleMetrics)[src]

Include other metrics into this metrics.

impl From<Sample> for SampleMetrics[src]

impl Clone for SampleMetrics[src]

impl Debug for SampleMetrics[src]

Auto Trait Implementations

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]