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

Method hitRate

packages/client/lib/client/cache.ts:113–116  ·  view source on GitHub ↗

* Returns the hit rate of the cache. * This is defined as hitCount / requestCount, or 1.0 when requestCount is 0. * * @returns The ratio of cache requests that were hits (between 0.0 and 1.0)

()

Source from the content-addressed store, hash-verified

111 * @returns The ratio of cache requests that were hits (between 0.0 and 1.0)
112 */
113 hitRate(): number {
114 const requestCount = this.requestCount();
115 return requestCount === 0 ? 1.0 : this.hitCount / requestCount;
116 }
117
118 /**
119 * Returns the miss rate of the cache.

Callers 1

cache.spec.tsFile · 0.80

Calls 1

requestCountMethod · 0.95

Tested by

no test coverage detected