pub struct Stats {
pub hits: u64,
pub promotions: u64,
pub misses: u64,
pub inserts: u64,
pub updates: u64,
pub flips: u64,
pub entries: usize,
pub peak_entries: usize,
pub cap: usize,
}Expand description
What a cache has done since it was created or reset: see LruCache::stats.
Lookups are get, get_mut and the two get_or_insert_with methods; each is a hit, a
promotion or a miss. put is not a lookup: it counts as an insert or an update.
Fields§
§hits: u64Lookups found in the current generation.
promotions: u64Lookups found in the previous generation (moved back into the current one). These
are hits too, but they survived only because that generation had not been dropped
yet: many of them mean the keys in use slightly outnumber cap.
misses: u64Lookups that found nothing.
inserts: u64New keys added, by put or by a read-through’s miss.
updates: u64put calls on a key already in the cache.
flips: u64Flips: how often the current generation filled up.
entries: usizeEntries held now, in both generations (up to 2 * cap).
peak_entries: usizeThe most entries ever held: the memory the workload actually needed.
cap: usizeThe cache’s capacity.
Implementations§
Trait Implementations§
impl Copy for Stats
impl Eq for Stats
impl StructuralPartialEq for Stats
Auto Trait Implementations§
impl Freeze for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnsafeUnpin for Stats
impl UnwindSafe for Stats
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.