pub struct ServerMetrics {
pub requests_total: AtomicU64,
pub requests_successful: AtomicU64,
pub requests_failed: AtomicU64,
pub cache_hits: AtomicU64,
pub cache_misses: AtomicU64,
pub total_response_time_ms: AtomicU64,
}Expand description
Server metrics
Fields§
§requests_total: AtomicU64§requests_successful: AtomicU64§requests_failed: AtomicU64§cache_hits: AtomicU64§cache_misses: AtomicU64§total_response_time_ms: AtomicU64Implementations§
Source§impl ServerMetrics
impl ServerMetrics
pub fn record_request(&self, success: bool, response_time_ms: u64)
pub fn record_cache_hit(&self)
pub fn record_cache_miss(&self)
pub fn get_metrics(&self) -> MetricsResponse
Trait Implementations§
Source§impl Default for ServerMetrics
impl Default for ServerMetrics
Source§fn default() -> ServerMetrics
fn default() -> ServerMetrics
Returns the “default value” for a type. Read more
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