MetricsExt

Trait MetricsExt 

Source
pub trait MetricsExt: Metrics {
    // Provided methods
    async fn record_request(
        &self,
        name: &str,
        timer: Option<Box<dyn Timer + Send>>,
        success: bool,
    ) { ... }
    async fn record_request_with_tags(
        &self,
        name: &str,
        timer: Option<Box<dyn Timer + Send>>,
        success: bool,
        tags: &[(&str, &str)],
    ) { ... }
    async fn record_error_with_context(
        &self,
        name: &str,
        error_type: &str,
        context: &str,
    ) { ... }
}
Expand description

Convenience methods for common metric patterns

Provided Methods§

Source

async fn record_request( &self, name: &str, timer: Option<Box<dyn Timer + Send>>, success: bool, )

Record a request with timing and success/failure

Source

async fn record_request_with_tags( &self, name: &str, timer: Option<Box<dyn Timer + Send>>, success: bool, tags: &[(&str, &str)], )

Record a request with timing, success/failure, and tags

Source

async fn record_error_with_context( &self, name: &str, error_type: &str, context: &str, )

Record an error with context

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§