getStats method

CacheStats getStats()

Gets cache statistics.

Returns a statistics object containing various cache performance metrics. Statistics are tracked in real-time and provide insights into cache usage.

Returns:

  • hits: Number of successful cache retrievals
  • misses: Number of cache misses
  • sets: Number of cache writes
  • deletions: Number of cache deletions
  • clears: Number of cache clears
  • hitRate: Cache hit rate as a percentage (0.0 to 100.0)
  • totalOperations: Total number of cache operations

Implementation

CacheStats getStats() {
  return _stats.copy();
}