MCPcopy
hub / github.com/redis/node-redis / DisabledStatsCounter

Class DisabledStatsCounter

packages/client/lib/client/cache.ts:264–275  ·  view source on GitHub ↗

* A StatsCounter implementation that does nothing and always returns empty stats.

Source from the content-addressed store, hash-verified

262 * A StatsCounter implementation that does nothing and always returns empty stats.
263 */
264class 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected