* A StatsCounter implementation that does nothing and always returns empty stats.
| 262 | * A StatsCounter implementation that does nothing and always returns empty stats. |
| 263 | */ |
| 264 | class DisabledStatsCounter implements StatsCounter { |
| 265 | static readonly INSTANCE = new DisabledStatsCounter(); |
| 266 | |
| 267 | private constructor() { } |
| 268 | |
| 269 | recordHits(count: number): void { } |
| 270 | recordMisses(count: number): void { } |
| 271 | recordLoadSuccess(loadTime: number): void { } |
| 272 | recordLoadFailure(loadTime: number): void { } |
| 273 | recordEvictions(count: number): void { } |
| 274 | snapshot(): CacheStats { return CacheStats.empty(); } |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * Returns a StatsCounter that does not record any cache events. |
nothing calls this directly
no outgoing calls
no test coverage detected