Skip to main content

MetricsCollector

Trait MetricsCollector 

Source
pub trait MetricsCollector {
    // Required methods
    fn counter(&self, name: &str, value: u64, tags: Option<&[(&str, &str)]>);
    fn gauge(&self, name: &str, value: f64, tags: Option<&[(&str, &str)]>);
    fn histogram(&self, name: &str, value: f64, tags: Option<&[(&str, &str)]>);
    fn timer(&self, name: &str) -> Timer;
}
Expand description

Monitoring and metrics abstraction

§Synchronous Version

This trait provides synchronous operations for metrics collection.

Required Methods§

Source

fn counter(&self, name: &str, value: u64, tags: Option<&[(&str, &str)]>)

Record a counter metric

Source

fn gauge(&self, name: &str, value: f64, tags: Option<&[(&str, &str)]>)

Record a gauge metric

Source

fn histogram(&self, name: &str, value: f64, tags: Option<&[(&str, &str)]>)

Record a histogram metric

Source

fn timer(&self, name: &str) -> Timer

Start a timer

Implementors§