Get current statistics
(&self)
| 359 | |
| 360 | /// Get current statistics |
| 361 | pub fn get_stats(&self) -> MemoryAwareCacheStats { |
| 362 | let caches = self.managed_caches.read(); |
| 363 | let mut stats = self.stats.write(); |
| 364 | |
| 365 | // Update current statistics |
| 366 | stats.total_managed_caches = caches.len(); |
| 367 | stats.total_entries = caches.iter().map(|(_, cache)| cache.len()).sum(); |
| 368 | stats.total_memory_bytes = caches.iter().map(|(_, cache)| cache.memory_usage_bytes()).sum(); |
| 369 | |
| 370 | stats.clone() |
| 371 | } |
| 372 | |
| 373 | /// Get detailed cache information |
| 374 | pub fn get_cache_info(&self) -> Vec<(String, String)> { |