pub struct ServerMetrics { /* private fields */ }Expand description
Server metrics collection
Implementations§
Source§impl ServerMetrics
impl ServerMetrics
Sourcepub fn record_request(&self, tool: &str, success: bool, duration: Duration)
pub fn record_request(&self, tool: &str, success: bool, duration: Duration)
Record a tool request
Sourcepub fn record_cache_operation(&self, operation: &str, cache_type: &str)
pub fn record_cache_operation(&self, operation: &str, cache_type: &str)
Record a cache operation
Sourcepub fn record_cache_hit(&self, cache_type: &str)
pub fn record_cache_hit(&self, cache_type: &str)
Record a cache hit
Sourcepub fn record_cache_miss(&self, cache_type: &str)
pub fn record_cache_miss(&self, cache_type: &str)
Record a cache miss
Sourcepub fn update_cache_hit_rate(&self, hits: u64, misses: u64)
pub fn update_cache_hit_rate(&self, hits: u64, misses: u64)
Update cache hit rate
Sourcepub fn record_http_request(
&self,
method: &str,
status: u16,
host: &str,
duration: Duration,
)
pub fn record_http_request( &self, method: &str, status: u16, host: &str, duration: Duration, )
Record an HTTP request
Sourcepub fn inc_active_connections(&self)
pub fn inc_active_connections(&self)
Increment active connections
Sourcepub fn dec_active_connections(&self)
pub fn dec_active_connections(&self)
Decrement active connections
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 UnsafeUnpin 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