pub struct TieredCacheStats {
pub l1_stats: CacheStats,
pub l2_stats: CacheStats,
pub promotions: u64,
}Expand description
Multi-level cache statistics.
Fields§
§l1_stats: CacheStatsL1 cache statistics.
l2_stats: CacheStatsL2 cache statistics.
promotions: u64L1 to L2 promotion count.
Implementations§
Source§impl TieredCacheStats
impl TieredCacheStats
Sourcepub fn new(l1_stats: CacheStats, l2_stats: CacheStats, promotions: u64) -> Self
pub fn new(l1_stats: CacheStats, l2_stats: CacheStats, promotions: u64) -> Self
Create new tiered cache statistics.
Sourcepub fn combined_hit_rate(&self) -> f64
pub fn combined_hit_rate(&self) -> f64
Get combined hit rate across both levels.
Sourcepub fn total_size(&self) -> usize
pub fn total_size(&self) -> usize
Get total size across both levels.
Sourcepub fn total_capacity(&self) -> usize
pub fn total_capacity(&self) -> usize
Get total capacity across both levels.
Trait Implementations§
Source§impl Clone for TieredCacheStats
impl Clone for TieredCacheStats
Source§fn clone(&self) -> TieredCacheStats
fn clone(&self) -> TieredCacheStats
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 TieredCacheStats
impl Debug for TieredCacheStats
Source§impl<'de> Deserialize<'de> for TieredCacheStats
impl<'de> Deserialize<'de> for TieredCacheStats
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 TieredCacheStats
impl RefUnwindSafe for TieredCacheStats
impl Send for TieredCacheStats
impl Sync for TieredCacheStats
impl Unpin for TieredCacheStats
impl UnwindSafe for TieredCacheStats
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