Get Cache Statistics
cache_get_statsRetrieve cache statistics and performance metrics including size, hit rates, entry counts, and compression details to monitor cache health.
Instructions
📖 Get cache statistics and performance metrics (read-only, safe for unsupervised use)
Retrieve comprehensive statistics about the cache system including size, hit rates, entry counts, and performance metrics.
Returns: Dictionary containing cache statistics: - total_entries: Total number of cached entries - total_bytes: Total size of cache in bytes - total_size_mb: Total size in megabytes - size_percentage: Percentage of max cache size used - total_hits: Number of cache hits - hit_rate: None until cache misses are tracked - entries_by_resource_type: Count of entries per resource type - average_entry_size_bytes: Average size per entry - compressed_entries: Number of compressed entries - compression_ratio: Average compression ratio - oldest_entry_age_hours: Age of oldest entry in hours - cleanup_triggered: Whether cleanup threshold has been reached - last_cleanup: Timestamp of last cleanup operation
Example: stats = cache_get_stats() print(f"Cache size: {stats['total_size_mb']:.2f} MB") print(f"Size used: {stats['size_percentage']:.1f}%")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||