Struct SqliteExporter

Source
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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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::Expression

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>>::Expression
where &'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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.