pub struct SqliteExporter { /* private fields */ }
Expand description

Exports metrics by storing them in a SQLite database at a periodic interval

Implementations§

source§

impl SqliteExporter

source

pub fn new<P: AsRef<Path>>( flush_interval: Duration, keep_duration: Option<Duration>, path: P ) -> Result<Self>

Creates a new SqliteExporter that stores metrics in a SQLite database file.

flush_interval specifies how often metrics are flushed to SQLite/disk

keep_duration specifies how long data is kept before deleting, performed new()

source

pub fn set_periodic_housekeeping( &self, periodic_duration: Option<Duration>, retention: Option<Duration>, record_limit: Option<usize> )

Sets optional periodic house keeping, None to disable (disabled by default)

Notes

Periodic house keeping can affect metric recording, causing some data to be dropped during house keeping. Record limit if set will cause anything over limit + 25% of limit to be removed

source

pub fn install(self) -> Result<(), SetRecorderError>

Install recorder as metrics crate’s Recorder

Trait Implementations§

source§

impl Drop for SqliteExporter

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Recorder for SqliteExporter

source§

fn describe_counter( &self, key: KeyName, unit: Option<Unit>, description: SharedString )

Describes a counter. Read more
source§

fn describe_gauge( &self, key: KeyName, unit: Option<Unit>, description: SharedString )

Describes a gauge. Read more
source§

fn describe_histogram( &self, key: KeyName, unit: Option<Unit>, description: SharedString )

Describes a histogram. Read more
source§

fn register_counter(&self, key: &Key) -> Counter

Registers a counter.
source§

fn register_gauge(&self, key: &Key) -> Gauge

Registers a gauge.
source§

fn register_histogram(&self, key: &Key) -> Histogram

Registers a histogram.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,

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

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.