pub struct AccessStats {
pub hit_count: u64,
pub miss_count: u64,
pub last_access: u64,
pub total_access_time_ns: u64,
pub prefetch_hits: u64,
}Expand description
Access statistics for cache entries
Fields§
§hit_count: u64Number of cache hits
miss_count: u64Number of cache misses
last_access: u64Last access timestamp (monotonic)
total_access_time_ns: u64Total access time in nanoseconds
prefetch_hits: u64Number of prefetch hits
Implementations§
Source§impl AccessStats
impl AccessStats
Sourcepub fn record_hit(&mut self, access_time_ns: u64, timestamp: u64)
pub fn record_hit(&mut self, access_time_ns: u64, timestamp: u64)
Record a cache hit
Sourcepub fn record_miss(&mut self, timestamp: u64)
pub fn record_miss(&mut self, timestamp: u64)
Record a cache miss
Sourcepub fn record_prefetch_hit(&mut self)
pub fn record_prefetch_hit(&mut self)
Record a prefetch hit
Sourcepub fn avg_access_time_ns(&self) -> f64
pub fn avg_access_time_ns(&self) -> f64
Get average access time in nanoseconds
Sourcepub fn prefetch_effectiveness(&self) -> f64
pub fn prefetch_effectiveness(&self) -> f64
Get prefetch effectiveness (0.0 - 1.0)
Trait Implementations§
Source§impl Clone for AccessStats
impl Clone for AccessStats
Source§fn clone(&self) -> AccessStats
fn clone(&self) -> AccessStats
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccessStats
impl Debug for AccessStats
Source§impl Default for AccessStats
impl Default for AccessStats
Source§fn default() -> AccessStats
fn default() -> AccessStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AccessStats
impl RefUnwindSafe for AccessStats
impl Send for AccessStats
impl Sync for AccessStats
impl Unpin for AccessStats
impl UnwindSafe for AccessStats
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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