pub struct CacheStats { /* private fields */ }Expand description
Information regarding the usage of the in-memory cache
Note: hit/miss/eviction metrics are only collected when the “cache_metrics” feature is enabled.
used_bytes and budget_bytes are always available.
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn evictions(&self) -> u64
pub fn evictions(&self) -> u64
Number of times that data has been evicted, due to the cache being full
To increase the cache size use Builder::set_cache_size
Sourcepub fn read_hits(&self) -> u64
pub fn read_hits(&self) -> u64
Number of times that unmodified data has been read from the cache
Sourcepub fn read_misses(&self) -> u64
pub fn read_misses(&self) -> u64
Number of times that unmodified data was not in the cache and was read from storage
Sourcepub fn write_hits(&self) -> u64
pub fn write_hits(&self) -> u64
Number of times that data modified in a transaction has been read from the cache
Sourcepub fn write_misses(&self) -> u64
pub fn write_misses(&self) -> u64
Number of times that data modified in a transaction was not in the cache and was read from storage
Sourcepub fn used_bytes(&self) -> usize
pub fn used_bytes(&self) -> usize
Number of bytes in the cache
Sourcepub fn budget_bytes(&self) -> Option<usize>
pub fn budget_bytes(&self) -> Option<usize>
The configured memory budget, if any.
Returns None when no budget is set (default), meaning the cache sizes
are controlled only by Builder::set_cache_size.
Trait Implementations§
Source§impl Clone for CacheStats
impl Clone for CacheStats
Source§fn clone(&self) -> CacheStats
fn clone(&self) -> CacheStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more