pub struct CacheStats {Show 14 fields
pub total_entries: u64,
pub expired_entries: u64,
pub valid_entries: u64,
pub average_age_seconds: u64,
pub min_age_seconds: u64,
pub max_age_seconds: u64,
pub memory_usage_estimate: usize,
pub hit_count: u64,
pub miss_count: u64,
pub total_accesses: u64,
pub insertions: u64,
pub removals: u64,
pub expired_cleaned: u64,
pub size_cleaned: u64,
}
Expand description
Cache statistics
Fields§
§total_entries: u64
Total entries
expired_entries: u64
Expired entries
valid_entries: u64
Valid entries
average_age_seconds: u64
Average entry age (seconds)
min_age_seconds: u64
Minimum entry age (seconds)
max_age_seconds: u64
Maximum entry age (seconds)
memory_usage_estimate: usize
Memory usage estimate (bytes)
hit_count: u64
Hit count
miss_count: u64
Miss count
total_accesses: u64
Total accesses
insertions: u64
Insertions
removals: u64
Removals
expired_cleaned: u64
Expired cleaned count
size_cleaned: u64
Size cleaned count
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn miss_ratio(&self) -> f64
pub fn miss_ratio(&self) -> f64
Miss ratio
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Is healthy (hit ratio > 0.8 and expired entries < 1/4 of total)
Sourcepub fn efficiency_score(&self) -> f64
pub fn efficiency_score(&self) -> f64
Efficiency score (hit ratio * (1 - expired ratio))
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 moreAuto 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