mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 18:55:39 +00:00
fix(cache): wire trusted-proxy cache and remove stale cache traces (#2581)
This commit is contained in:
@@ -178,6 +178,33 @@ impl ProxyMetrics {
|
||||
});
|
||||
}
|
||||
|
||||
/// Records a cache hit.
|
||||
pub fn record_cache_hit(&self) {
|
||||
if !self.enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
counter!("rustfs_trusted_proxy_cache_hits_total", "app" => self.app_name.clone()).increment(1);
|
||||
}
|
||||
|
||||
/// Records a cache miss.
|
||||
pub fn record_cache_miss(&self) {
|
||||
if !self.enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
counter!("rustfs_trusted_proxy_cache_misses_total", "app" => self.app_name.clone()).increment(1);
|
||||
}
|
||||
|
||||
/// Updates only the cache size gauge.
|
||||
pub fn set_cache_size(&self, size: usize) {
|
||||
if !self.enabled {
|
||||
return;
|
||||
}
|
||||
|
||||
gauge!("rustfs_trusted_proxy_cache_size", "app" => self.app_name.clone()).set(size as f64);
|
||||
}
|
||||
|
||||
/// Records cache performance metrics.
|
||||
pub fn record_cache_metrics(&self, hits: u64, misses: u64, size: usize) {
|
||||
if !self.enabled {
|
||||
|
||||
Reference in New Issue
Block a user