pub struct WindowedCacheMetrics {
pub window_hits: u64,
pub window_misses: u64,
pub window_evictions: u64,
pub window_inserts: u64,
pub window_size: usize,
}Expand description
Windowed cache metrics.
Fields§
§window_hits: u64§window_misses: u64§window_evictions: u64§window_inserts: u64§window_size: usizeImplementations§
Source§impl WindowedCacheMetrics
impl WindowedCacheMetrics
pub fn new(window_size: usize) -> Self
pub fn record_hit(&mut self)
pub fn record_miss(&mut self)
pub fn record_eviction(&mut self)
pub fn record_insert(&mut self)
pub fn hit_rate(&self) -> f64
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for WindowedCacheMetrics
impl Clone for WindowedCacheMetrics
Source§fn clone(&self) -> WindowedCacheMetrics
fn clone(&self) -> WindowedCacheMetrics
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 WindowedCacheMetrics
impl Debug for WindowedCacheMetrics
Source§impl Default for WindowedCacheMetrics
impl Default for WindowedCacheMetrics
Source§fn default() -> WindowedCacheMetrics
fn default() -> WindowedCacheMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WindowedCacheMetrics
impl RefUnwindSafe for WindowedCacheMetrics
impl Send for WindowedCacheMetrics
impl Sync for WindowedCacheMetrics
impl Unpin for WindowedCacheMetrics
impl UnsafeUnpin for WindowedCacheMetrics
impl UnwindSafe for WindowedCacheMetrics
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