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§
Sourcefn record_metric(
&self,
metric_name: &str,
value: f64,
) -> Result<(), PipelineError>
fn record_metric( &self, metric_name: &str, value: f64, ) -> Result<(), PipelineError>
Records a metric value
Sourcefn increment_counter(&self, counter_name: &str) -> Result<(), PipelineError>
fn increment_counter(&self, counter_name: &str) -> Result<(), PipelineError>
Increments a counter metric
Sourcefn record_timing(
&self,
operation_name: &str,
duration_ms: u64,
) -> Result<(), PipelineError>
fn record_timing( &self, operation_name: &str, duration_ms: u64, ) -> Result<(), PipelineError>
Records timing information
Sourcefn get_metrics_snapshot(&self) -> Result<S, PipelineError>
fn get_metrics_snapshot(&self) -> Result<S, PipelineError>
Gets current metrics snapshot