ServiceMetrics

Trait ServiceMetrics 

Source
pub trait ServiceMetrics<S: ServiceStats> {
    // Required methods
    fn record_metric(
        &self,
        metric_name: &str,
        value: f64,
    ) -> Result<(), PipelineError>;
    fn increment_counter(&self, counter_name: &str) -> Result<(), PipelineError>;
    fn record_timing(
        &self,
        operation_name: &str,
        duration_ms: u64,
    ) -> Result<(), PipelineError>;
    fn get_metrics_snapshot(&self) -> Result<S, PipelineError>;
}
Expand description

Trait for services that support metrics collection

Required Methods§

Source

fn record_metric( &self, metric_name: &str, value: f64, ) -> Result<(), PipelineError>

Records a metric value

Source

fn increment_counter(&self, counter_name: &str) -> Result<(), PipelineError>

Increments a counter metric

Source

fn record_timing( &self, operation_name: &str, duration_ms: u64, ) -> Result<(), PipelineError>

Records timing information

Source

fn get_metrics_snapshot(&self) -> Result<S, PipelineError>

Gets current metrics snapshot

Implementors§