pub struct CacheStats { /* private fields */ }Expand description
Cache statistics for tracking performance and effectiveness
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn record_hit(&self, bytes: u64)
pub fn record_hit(&self, bytes: u64)
Record a cache hit with the number of bytes served
Sourcepub fn record_miss(&self)
pub fn record_miss(&self)
Record a cache miss
Sourcepub fn record_eviction(&self, bytes: u64)
pub fn record_eviction(&self, bytes: u64)
Record a cache eviction with the number of bytes evicted
Sourcepub fn record_write(&self, bytes: u64)
pub fn record_write(&self, bytes: u64)
Record a write operation with the number of bytes written
Sourcepub fn record_delete(&self)
pub fn record_delete(&self)
Record a delete operation
Sourcepub fn bytes_saved(&self) -> u64
pub fn bytes_saved(&self) -> u64
Get total bytes saved by cache hits
Sourcepub fn bytes_written(&self) -> u64
pub fn bytes_written(&self) -> u64
Get total bytes written to cache
Sourcepub fn bytes_evicted(&self) -> u64
pub fn bytes_evicted(&self) -> u64
Get total bytes evicted from cache
Sourcepub fn total_operations(&self) -> u64
pub fn total_operations(&self) -> u64
Get total cache operations (hits + misses)
Sourcepub fn snapshot(&self) -> CacheStatsSnapshot
pub fn snapshot(&self) -> CacheStatsSnapshot
Get a snapshot of current statistics
Sourcepub fn report(&self) -> CacheReport
pub fn report(&self) -> CacheReport
Generate a comprehensive performance report
Trait Implementations§
Source§impl Clone for CacheStats
impl Clone for CacheStats
Source§fn clone(&self) -> CacheStats
fn clone(&self) -> CacheStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheStats
impl Debug for CacheStats
Auto Trait Implementations§
impl Freeze for CacheStats
impl RefUnwindSafe for CacheStats
impl Send for CacheStats
impl Sync for CacheStats
impl Unpin for CacheStats
impl UnwindSafe for CacheStats
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