diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf4b8f9b..4e625b93c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Adds hitRate metric to DiskCache. + ## [6.45.15] - 2023-02-01 + ### Changed + - Removed unnecessary worker signal logs ## [6.45.14] - 2023-02-01 @@ -23,7 +29,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Do not return empty content if no conflict is found. ## [6.45.13] - 2022-12-12 + ### Changed + - Deterministic cache for getWithBody - Remove socket metrics per origin @@ -1756,7 +1764,6 @@ instead - `HttpClient` now adds `'Accept-Encoding': 'gzip'` header by default. - [Unreleased]: https://github.com/vtex/node-vtex-api/compare/v6.45.15...HEAD [6.45.15]: https://github.com/vtex/node-vtex-api/compare/v6.45.14...v6.45.15 [6.45.14]: https://github.com/vtex/node-vtex-api/compare/v6.45.13...v6.45.14 diff --git a/src/caches/DiskCache.ts b/src/caches/DiskCache.ts index af883c823..2be901ea1 100644 --- a/src/caches/DiskCache.ts +++ b/src/caches/DiskCache.ts @@ -22,6 +22,7 @@ export class DiskCache implements CacheLayer{ public getStats = (name='disk-cache'): DiskStats => { const stats = { + hitRate: this.total > 0 ? this.hits / this.total : undefined, hits: this.hits, name, total: this.total,