CacheAnalytics class

A class that tracks and provides analytics for cache operations.

Constructors

CacheAnalytics({int maxRecentOperations = 100})
Creates a new instance of CacheAnalytics.

Properties

averageItemSize → double
Gets the average size of items in the cache.
no setter
clearCount → int
Gets the total number of cache clears.
no setter
deleteCount → int
Gets the total number of cache deletes.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hitCount → int
Gets the total number of cache hits.
no setter
hitRate → double
Gets the cache hit rate (hits / total operations).
no setter
largestItems → List<MapEntry<String, int>>
Gets the largest items in the cache.
no setter
maxSize → int
Gets the maximum size observed in the cache.
no setter
missCount → int
Gets the total number of cache misses.
no setter
mostFrequentlyAccessedKeys → List<MapEntry<String, int>>
Gets the most frequently accessed keys.
no setter
mostRecentlyAccessedKeys → List<MapEntry<String, DateTime>>
Gets the most recently accessed keys.
no setter
putCount → int
Gets the total number of cache puts.
no setter
recentOperations → List<CacheOperation>
Gets the recent operations for detailed analysis.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startTime → DateTime
Gets the time when the analytics tracking started.
no setter
totalOperations → int
Gets the total number of cache operations (hits + misses).
no setter
totalSize → int
Gets the total size of all items in the cache (estimated).
no setter
uptime → Duration
Gets the duration since the analytics tracking started.
no setter

Methods

getSummary() → Map<String, dynamic>
Gets a summary of the cache analytics.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordClear() → void
Records a cache clear.
recordDelete(String key) → void
Records a cache delete for the given key.
recordHit(String key) → void
Records a cache hit for the given key.
recordMiss(String key) → void
Records a cache miss for the given key.
recordPut(String key, int estimatedSize) → void
Records a cache put for the given key with the estimated size.
reset() → void
Resets all analytics data.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited