* 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)
()
| 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. |
no test coverage detected