Skip to main content

Metrics

Trait Metrics 

Source
pub trait Metrics:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn on_request(&self, _method: &str) { ... }
    fn on_response(&self, _method: &str) { ... }
    fn on_error(&self, _method: &str, _error: &str) { ... }
    fn on_queue_depth_change(&self, _active_queues: usize) { ... }
}
Expand description

Trait for receiving metrics callbacks from the handler.

All methods have default no-op implementations so that consumers can override only the callbacks they care about.

Provided Methods§

Source

fn on_request(&self, _method: &str)

Called when a request is received, before processing.

Source

fn on_response(&self, _method: &str)

Called when a response is successfully sent.

Source

fn on_error(&self, _method: &str, _error: &str)

Called when a request results in an error.

Source

fn on_queue_depth_change(&self, _active_queues: usize)

Called when the number of active event queues changes.

Implementors§