pub trait MetricsEnabled<T>where
T: CollectibleMetrics,{
// 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§
Sourcefn metrics_collector(&self) -> &GenericMetricsCollector<T>
fn metrics_collector(&self) -> &GenericMetricsCollector<T>
Gets the metrics collector for this service
Provided Methods§
Sourcefn 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_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
Sourcefn 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 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