Skip to main content

DatabaseMetrics

Trait DatabaseMetrics 

Source
pub trait DatabaseMetrics {
    // Provided methods
    fn report_metrics(&self) { ... }
    fn gauge_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)> { ... }
    fn counter_metrics(&self) -> Vec<(&'static str, u64, Vec<Label>)> { ... }
    fn histogram_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)> { ... }
}
Expand description

Represents a type that can report metrics, used mainly with the database. The report_metrics method can be used as a prometheus hook.

Provided Methods§

Source

fn report_metrics(&self)

Reports metrics for the database.

Source

fn gauge_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Returns a list of Gauge metrics for the database.

Source

fn counter_metrics(&self) -> Vec<(&'static str, u64, Vec<Label>)>

Returns a list of Counter metrics for the database.

Source

fn histogram_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Returns a list of Histogram metrics for the database.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<DB> DatabaseMetrics for Arc<DB>
where DB: DatabaseMetrics,

Source§

fn report_metrics(&self)

Source§

fn gauge_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Source§

fn counter_metrics(&self) -> Vec<(&'static str, u64, Vec<Label>)>

Source§

fn histogram_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Implementors§

Source§

impl DatabaseMetrics for DatabaseEnv

Available on crate feature mdbx only.
Source§

impl DatabaseMetrics for DatabaseMock

Source§

impl<DB: DatabaseMetrics> DatabaseMetrics for TempDatabase<DB>

Available on crate features test-utils only.