pub trait MetricsCollector: Send + Sync {
// Required methods
fn record_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
response: &'life2 HttpResponse,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn record_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
error: &'life1 FerrumError,
endpoint: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_metrics(&self) -> ServerMetrics;
fn reset_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Metrics collector for server
Required Methods§
Sourcefn record_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
response: &'life2 HttpResponse,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn record_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 HttpRequest,
response: &'life2 HttpResponse,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Record request metrics
Sourcefn record_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
error: &'life1 FerrumError,
endpoint: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn record_error<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
error: &'life1 FerrumError,
endpoint: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Record error metrics
Sourcefn get_metrics(&self) -> ServerMetrics
fn get_metrics(&self) -> ServerMetrics
Get current metrics
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".