CacheMetrics

Trait CacheMetrics 

Source
pub trait CacheMetrics: Send + Sync {
    // Provided methods
    fn record_hit(&self, key: &str, duration: Duration) { ... }
    fn record_miss(&self, key: &str, duration: Duration) { ... }
    fn record_set(&self, key: &str, duration: Duration) { ... }
    fn record_delete(&self, key: &str, duration: Duration) { ... }
    fn record_error(&self, key: &str, error: &str) { ... }
}
Expand description

Trait for cache metrics collection.

Provided Methods§

Source

fn record_hit(&self, key: &str, duration: Duration)

Record a cache hit.

Source

fn record_miss(&self, key: &str, duration: Duration)

Record a cache miss.

Source

fn record_set(&self, key: &str, duration: Duration)

Record a cache set operation.

Source

fn record_delete(&self, key: &str, duration: Duration)

Record a cache delete operation.

Source

fn record_error(&self, key: &str, error: &str)

Record an error.

Implementors§