Struct metrics_sqlite::MetricsDb[][src]

pub struct MetricsDb { /* fields omitted */ }

Metrics database, useful for querying stored metrics

Implementations

impl MetricsDb[src]

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Creates a new metrics DB with given path of a SQLite database

pub fn sessions(&self) -> &[Session][src]

Returns sessions in database, based on SESSION_TIME_GAP_THRESHOLD

pub fn available_keys(&self) -> Result<Vec<String>>[src]

Returns list of metrics keys stored in the database

pub fn metrics_for_key(
    &self,
    key_name: &str,
    session: Option<&Session>
) -> Result<Vec<Metric>>
[src]

Returns all metrics for given key in ascending timestamp order

pub fn deriv_metrics_for_key(
    &self,
    key_name: &str,
    session: Option<&Session>
) -> Result<Vec<DerivMetric>>
[src]

Returns rate of change, the derivative, of the given metrics key’s values

f(t) = (x(t + 1) - x(t)) / ((t+1) - (t)

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> IntoSql for T[src]

fn into_sql<T>(self) -> Self::Expression where
    Self: AsExpression<T>, 
[src]

Convert self to an expression for Diesel’s query builder. Read more

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
    &'a Self: AsExpression<T>, 
[src]

Convert &self to an expression for Diesel’s query builder. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.