Struct metrics_sqlite::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
impl SqliteExporter
sourcepub fn new<P: AsRef<Path>>(
flush_interval: Duration,
keep_duration: Option<Duration>,
path: P
) -> Result<Self>
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()
sourcepub fn set_periodic_housekeeping(
&self,
periodic_duration: Option<Duration>,
retention: Option<Duration>,
record_limit: Option<usize>
)
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
sourcepub fn install(self) -> Result<(), SetRecorderError>
pub fn install(self) -> Result<(), SetRecorderError>
Install recorder as metrics
crate’s Recorder
Trait Implementations§
source§impl Drop for SqliteExporter
impl Drop for SqliteExporter
source§impl Recorder for SqliteExporter
impl Recorder for SqliteExporter
source§fn describe_counter(
&self,
key: KeyName,
unit: Option<Unit>,
description: SharedString
)
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
)
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
)
fn describe_histogram( &self, key: KeyName, unit: Option<Unit>, description: SharedString )
Describes a histogram. Read more
source§fn register_counter(&self, key: &Key) -> Counter
fn register_counter(&self, key: &Key) -> Counter
Registers a counter.
source§fn register_gauge(&self, key: &Key) -> Gauge
fn register_gauge(&self, key: &Key) -> Gauge
Registers a gauge.
source§fn register_histogram(&self, key: &Key) -> Histogram
fn register_histogram(&self, key: &Key) -> Histogram
Registers a histogram.
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteExporter
impl Send for SqliteExporter
impl Sync for SqliteExporter
impl Unpin for SqliteExporter
impl !UnwindSafe for SqliteExporter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
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 moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
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