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§
Sourcefn record_hit(&self, key: &str, duration: Duration)
fn record_hit(&self, key: &str, duration: Duration)
Record a cache hit.
Sourcefn record_miss(&self, key: &str, duration: Duration)
fn record_miss(&self, key: &str, duration: Duration)
Record a cache miss.
Sourcefn record_set(&self, key: &str, duration: Duration)
fn record_set(&self, key: &str, duration: Duration)
Record a cache set operation.
Sourcefn record_delete(&self, key: &str, duration: Duration)
fn record_delete(&self, key: &str, duration: Duration)
Record a cache delete operation.
Sourcefn record_error(&self, key: &str, error: &str)
fn record_error(&self, key: &str, error: &str)
Record an error.