pub enum Metrics {
Noop,
Op(MetricsInner),
}Expand description
Metrics is a snapshot of performance statistics for the lifetime of a cache instance.
Metrics promises thread-safe.
Variants
Noop
No operation metrics
Op(MetricsInner)
Op metrics
Implementations
sourceimpl Metrics
impl Metrics
sourcepub fn get_hits(&self) -> Option<u64>
pub fn get_hits(&self) -> Option<u64>
Returns the number of Get calls where a value was found for the corresponding key.
sourcepub fn get_misses(&self) -> Option<u64>
pub fn get_misses(&self) -> Option<u64>
Returns the number of Get calls where a value was not found for the corresponding key.
sourcepub fn get_keys_added(&self) -> Option<u64>
pub fn get_keys_added(&self) -> Option<u64>
Returns the total number of Set calls where a new key-value item was added.
sourcepub fn get_keys_updated(&self) -> Option<u64>
pub fn get_keys_updated(&self) -> Option<u64>
Returns the total number of Set calls where a new key-value item was updated.
sourcepub fn get_keys_evicted(&self) -> Option<u64>
pub fn get_keys_evicted(&self) -> Option<u64>
Returns the total number of keys evicted.
sourcepub fn get_cost_added(&self) -> Option<u64>
pub fn get_cost_added(&self) -> Option<u64>
Returns the sum of costs that have been added (successful Set calls).
sourcepub fn get_cost_evicted(&self) -> Option<u64>
pub fn get_cost_evicted(&self) -> Option<u64>
Returns the sum of all costs that have been evicted.
sourcepub fn get_sets_dropped(&self) -> Option<u64>
pub fn get_sets_dropped(&self) -> Option<u64>
Returns the number of Set calls that don’t make it into internal buffers (due to contention or some other reason).
sourcepub fn get_sets_rejected(&self) -> Option<u64>
pub fn get_sets_rejected(&self) -> Option<u64>
Returns the number of Set calls rejected by the policy (TinyLFU).
sourcepub fn get_gets_dropped(&self) -> Option<u64>
pub fn get_gets_dropped(&self) -> Option<u64>
Returns the number of Get counter increments that are dropped internally.
sourcepub fn get_gets_kept(&self) -> Option<u64>
pub fn get_gets_kept(&self) -> Option<u64>
Returns the number of Get counter increments that are kept.
sourcepub fn ratio(&self) -> Option<f64>
pub fn ratio(&self) -> Option<f64>
Ratio is the number of Hits over all accesses (Hits + Misses). This is the percentage of successful Get calls.
sourcepub fn life_expectancy_seconds(&self) -> Option<Histogram>
pub fn life_expectancy_seconds(&self) -> Option<Histogram>
Returns the histogram data of this metrics
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl !UnwindSafe for Metrics
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more