pub struct ServerMetrics { /* private fields */ }
Expand description
Server metrics collection
Implementations§
Source§impl ServerMetrics
impl ServerMetrics
pub fn new() -> Self
pub fn record_request(&mut self, method: &str)
pub fn record_response_time(&mut self, _method: &str, duration: Duration)
pub fn record_error(&mut self, _method: &str, _error: &str)
pub fn record_connection(&mut self)
pub fn record_disconnection(&mut self)
pub fn get_stats(&self) -> MetricsStats
pub fn get_most_popular_endpoints(&self, limit: usize) -> Vec<(String, u64)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerMetrics
impl RefUnwindSafe for ServerMetrics
impl Send for ServerMetrics
impl Sync for ServerMetrics
impl Unpin for ServerMetrics
impl UnwindSafe for ServerMetrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more