pub struct CacheStats {
pub entries: usize,
pub size_mb: usize,
pub max_size_mb: usize,
pub enabled: bool,
pub cache_dir: PathBuf,
pub hits: u64,
pub misses: u64,
pub evictions: u64,
pub hit_rate: f64,
pub compression_enabled: bool,
}Expand description
Cache statistics with LRU metrics
Fields§
§entries: usizeNumber of cache entries
size_mb: usizeCurrent cache size in MB
max_size_mb: usizeMaximum cache size in MB
enabled: boolWhether caching is enabled
cache_dir: PathBufCache directory path (serialized as string for JSON compatibility)
hits: u64Total cache hits
misses: u64Total cache misses
evictions: u64Total evictions
hit_rate: f64Hit rate percentage
compression_enabled: boolWhether compression is enabled
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn export_to_file(&self, path: &Path) -> Result<()>
pub fn export_to_file(&self, path: &Path) -> Result<()>
Export cache statistics to a JSON file
Sourcepub fn get_analytics(&self) -> CacheAnalytics
pub fn get_analytics(&self) -> CacheAnalytics
Get analytics report with derived metrics
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
Source§impl<'de> Deserialize<'de> for CacheStats
impl<'de> Deserialize<'de> for CacheStats
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more