MetricsEnabled

Trait MetricsEnabled 

Source
pub trait MetricsEnabled<T>{
    // Required method
    fn metrics_collector(&self) -> &GenericMetricsCollector<T>;

    // Provided methods
    fn record_success<'life0, 'async_trait>(
        &'life0 self,
        operation_id: String,
        operation_type: String,
        metrics: T,
    ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn record_failure<'life0, 'async_trait>(
        &'life0 self,
        operation_id: String,
        operation_type: String,
        error: PipelineError,
    ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_metrics_summary<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, PipelineError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Trait for services that support metrics collection

Required Methods§

Source

fn metrics_collector(&self) -> &GenericMetricsCollector<T>

Gets the metrics collector for this service

Provided Methods§

Source

fn record_success<'life0, 'async_trait>( &'life0 self, operation_id: String, operation_type: String, metrics: T, ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Records a successful operation

Source

fn record_failure<'life0, 'async_trait>( &'life0 self, operation_id: String, operation_type: String, error: PipelineError, ) -> Pin<Box<dyn Future<Output = Result<(), PipelineError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Records a failed operation

Source

fn get_metrics_summary<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, PipelineError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Gets current metrics summary

Implementors§