Expand description
Metrics hooks for observing handler activity.
Implement Metrics to receive callbacks on requests, responses, errors,
latency, and queue depth changes. The default no-op implementation can be
overridden selectively.
§Example
use a2a_protocol_server::metrics::Metrics;
use std::time::Duration;
struct MyMetrics;
impl Metrics for MyMetrics {
fn on_request(&self, method: &str) {
println!("request: {method}");
}
fn on_latency(&self, method: &str, duration: Duration) {
println!("{method} took {duration:?}");
}
}Structs§
- Connection
Pool Stats - Statistics about the HTTP connection pool.
- Noop
Metrics - A no-op
Metricsimplementation that discards all events.
Traits§
- Metrics
- Trait for receiving metrics callbacks from the handler.