pub struct CacheStats {
pub hits: u64,
pub misses: u64,
pub inserts: u64,
pub capacity_evictions: u64,
pub invalidations: u64,
pub single_flight_joins: u64,
pub single_flight_errors: u64,
}Expand description
Counters reported by ClockTtlCache::stats.
Monotonic since construction (or the most recent reset_stats call);
returned by value so callers own a snapshot, not a reference into the
live atomics.
Fields§
§hits: u64Successful get hits. TTL-expired entries evicted on access count
as misses, not hits.
misses: u64get calls that returned None (key absent or expired). Includes
single-flight cache lookups inside get_or_try_insert_with.
inserts: u64Successful inserts (fresh and overwriting).
capacity_evictions: u64Entries evicted by LRU capacity pressure during inserts.
invalidations: u64Entries removed by explicit invalidate / invalidate_by /
invalidate_all / cleanup_expired calls.
single_flight_joins: u64Concurrent get_or_try_insert_with calls that joined an in-flight
load instead of starting their own. High values mean duplicate
fetches successfully avoided.
single_flight_errors: u64get_or_try_insert_with fetcher invocations that returned an
error. The cell is removed on error so subsequent callers retry
rather than re-await a known-failing future.
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 moreSource§impl Debug for CacheStats
impl Debug for CacheStats
Source§impl Default for CacheStats
impl Default for CacheStats
Source§fn default() -> CacheStats
fn default() -> CacheStats
Source§impl PartialEq for CacheStats
impl PartialEq for CacheStats
Source§fn eq(&self, other: &CacheStats) -> bool
fn eq(&self, other: &CacheStats) -> bool
self and other values to be equal, and is used by ==.impl Copy for CacheStats
impl Eq for CacheStats
impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.