pub struct CacheStats {
pub hits: u64,
pub misses: u64,
pub hit_rate: f64,
pub size_bytes: u64,
pub capacity_bytes: u64,
}Expand description
A point-in-time snapshot of block-cache effectiveness and occupancy.
Derived from Metrics (the cumulative hit / miss counters) plus the live
block cache’s current size and capacity, so an observability consumer gets a
stable owned value instead of reaching into the mutable &Arc<Metrics>.
Counts are cumulative since process start (they reset on restart, like all of
Metrics); derive a rate over an interval from the delta between two polls.
Fields§
§hits: u64Cumulative block reads served from the block cache (all block types).
misses: u64Cumulative block reads that missed the cache and hit disk (all block types).
hit_rate: f64Hit rate in 0.0..=1.0 (hits / (hits + misses)); 1.0 when no block
has been loaded yet (nothing has missed).
size_bytes: u64Current weighted bytes resident in the block cache.
capacity_bytes: u64Configured maximum bytes the block cache may hold.
Trait Implementations§
Source§impl Clone for CacheStats
impl Clone for CacheStats
Source§fn clone(&self) -> CacheStats
fn clone(&self) -> CacheStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CacheStats
Auto Trait Implementations§
impl Freeze for CacheStats
impl RefUnwindSafe for CacheStats
impl Send for CacheStats
impl Sync for CacheStats
impl Unpin for CacheStats
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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