Metrics

Struct Metrics 

Source
pub struct Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,
{ /* private fields */ }
Expand description

Struct containing all the metrics

Implementations§

Source§

impl<K, V> Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,

Source

pub fn new() -> Self

Source

pub fn get_hit_count(&self) -> u64

Source

pub fn get_miss_count(&self) -> u64

Source

pub fn get_miss_already_loading_count(&self) -> u64

Source

pub fn get_cancelled_count(&self) -> u64

Source

pub fn put_count(&self) -> u64

Source

pub fn eviction_count(&self) -> u64

Trait Implementations§

Source§

impl<K, V> CachePolicyListener for Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,

Source§

type K = K

Cache key.
Source§

type V = V

Cache value.
Source§

fn listen_on_get(&self, _k: Self::K, _v: Option<Self::V>)

Source§

fn listen_on_peek(&self, _k: Self::K, _v: Option<Self::V>)

Source§

fn listen_on_put(&self, _k: Self::K, _v: Self::V, _old_v: Option<Self::V>)

Source§

fn listen_on_remove(&self, _k: Self::K, _v: Option<Self::V>)

Source§

fn listen_on_pop(&self, _entry: (Self::K, Self::V))

Source§

impl<K, V> Debug for Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static + Debug, V: Clone + Debug + Send + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V> Default for Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K, V> LoadingCacheListener for Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,

Source§

type K = K

Cache key.
Source§

type V = V

Cache value.
Source§

fn listen_on_get_if_present(&self, _k: Self::K, v: Option<Self::V>)

Source§

fn listen_on_get(&self, _k: Self::K, _v: Self::V, status: CacheGetStatus)

Source§

fn listen_on_put(&self, _k: Self::K, _v: Self::V)

Source§

fn listen_on_invalidate(&self, _k: Self::K)

Source§

fn listen_on_get_cancelling(&self, _k: Self::K)

Source§

impl<K, V> Sync for Metrics<K, V>
where K: Clone + Eq + Hash + Ord + Debug + Send + 'static, V: Clone + Debug + Send + 'static,

Auto Trait Implementations§

§

impl<K, V> Freeze for Metrics<K, V>

§

impl<K, V> RefUnwindSafe for Metrics<K, V>

§

impl<K, V> Send for Metrics<K, V>

§

impl<K, V> Unpin for Metrics<K, V>
where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for Metrics<K, V>
where K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.