pub struct MetricsCollector { /* private fields */ }Expand description
Metrics collector for BWS Web Server
Implementations§
Source§impl MetricsCollector
impl MetricsCollector
Sourcepub fn record_request(
&self,
status_code: u16,
response_time: Duration,
bytes: u64,
)
pub fn record_request( &self, status_code: u16, response_time: Duration, bytes: u64, )
Record a request with status code and response time
Sourcepub fn increment_connections(&self)
pub fn increment_connections(&self)
Increment active connections
Sourcepub fn decrement_connections(&self)
pub fn decrement_connections(&self)
Decrement active connections
Sourcepub fn record_error(&self, error_type: &str)
pub fn record_error(&self, error_type: &str)
Record an error
Sourcepub fn get_metrics(&self) -> BwsResult<MetricsSnapshot>
pub fn get_metrics(&self) -> BwsResult<MetricsSnapshot>
Get current metrics snapshot
Trait Implementations§
Source§impl Debug for MetricsCollector
impl Debug for MetricsCollector
Auto Trait Implementations§
impl !Freeze for MetricsCollector
impl RefUnwindSafe for MetricsCollector
impl Send for MetricsCollector
impl Sync for MetricsCollector
impl Unpin for MetricsCollector
impl UnwindSafe for MetricsCollector
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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