pub struct CacheMetrics { /* private fields */ }Expand description
Thread-safe cache metrics collector.
Implementations§
Source§impl CacheMetrics
impl CacheMetrics
Sourcepub fn record_hit(&self, duration: Duration)
pub fn record_hit(&self, duration: Duration)
Record a cache hit.
Sourcepub fn record_miss(&self, duration: Duration)
pub fn record_miss(&self, duration: Duration)
Record a cache miss.
Sourcepub fn record_write(&self, duration: Duration)
pub fn record_write(&self, duration: Duration)
Record a write operation.
Sourcepub fn record_delete(&self)
pub fn record_delete(&self)
Record a delete operation.
Sourcepub fn record_error(&self)
pub fn record_error(&self)
Record an error.
Sourcepub fn snapshot(&self) -> CacheStats
pub fn snapshot(&self) -> CacheStats
Get a snapshot of the current stats.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CacheMetrics
impl RefUnwindSafe for CacheMetrics
impl Send for CacheMetrics
impl Sync for CacheMetrics
impl Unpin for CacheMetrics
impl UnwindSafe for CacheMetrics
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