pub struct CacheStats { /* private fields */ }Expand description
Statistics for the adaptive TTL cache
Implementations§
Source§impl CacheStats
impl CacheStats
Sourcepub fn record_hit(&self)
pub fn record_hit(&self)
Record a cache hit
Sourcepub fn record_miss(&self)
pub fn record_miss(&self)
Record a cache miss
Sourcepub fn record_eviction(&self, estimated_bytes: u64)
pub fn record_eviction(&self, estimated_bytes: u64)
Record an eviction
Sourcepub fn record_ttl_expiration(&self)
pub fn record_ttl_expiration(&self)
Record a TTL expiration
Sourcepub fn record_removal(&self)
pub fn record_removal(&self)
Record a removal
Sourcepub fn record_ttl_adaptation(&self, ttl: Duration)
pub fn record_ttl_adaptation(&self, ttl: Duration)
Record a TTL adaptation
Sourcepub fn update_entry_count(&self, count: usize)
pub fn update_entry_count(&self, count: usize)
Update entry count
Sourcepub fn record_cleanup(&self)
pub fn record_cleanup(&self)
Record a cleanup operation
Sourcepub fn hit_rate_percent(&self) -> f64
pub fn hit_rate_percent(&self) -> f64
Get the current hit rate as a percentage
Sourcepub fn ttl_expirations(&self) -> u64
pub fn ttl_expirations(&self) -> u64
Get total number of TTL expirations
Sourcepub fn ttl_adaptations(&self) -> u64
pub fn ttl_adaptations(&self) -> u64
Get total number of TTL adaptations
Sourcepub fn average_ttl_secs(&self) -> f64
pub fn average_ttl_secs(&self) -> f64
Get average TTL in seconds
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get current entry count
Sourcepub fn peak_entries(&self) -> usize
pub fn peak_entries(&self) -> usize
Get peak entry count
Sourcepub fn cleanup_operations(&self) -> u64
pub fn cleanup_operations(&self) -> u64
Get total cleanup operations
Sourcepub fn bytes_evicted(&self) -> u64
pub fn bytes_evicted(&self) -> u64
Get total bytes evicted
Sourcepub fn snapshot(&self) -> CacheStatsSnapshot
pub fn snapshot(&self) -> CacheStatsSnapshot
Get a snapshot of all statistics
Trait Implementations§
Source§impl Debug for CacheStats
impl Debug for CacheStats
Source§impl Default for CacheStats
impl Default for CacheStats
Source§fn default() -> CacheStats
fn default() -> CacheStats
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.