fix(cache): wire trusted-proxy cache and remove stale cache traces (#2581)

This commit is contained in:
houseme
2026-04-18 00:57:21 +08:00
committed by GitHub
parent 38eb0781cf
commit ffcf18f5f3
13 changed files with 231 additions and 51 deletions
@@ -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 {