Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firstandthird/hapi-cache-stats
https://github.com/firstandthird/hapi-cache-stats
hapi-plugin hapi-v17 has-tests needs-coverage
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/firstandthird/hapi-cache-stats
- Owner: firstandthird
- License: mit
- Created: 2017-05-26T06:06:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T11:45:24.000Z (about 2 years ago)
- Last Synced: 2024-04-16T00:42:30.302Z (10 months ago)
- Topics: hapi-plugin, hapi-v17, has-tests, needs-coverage
- Language: JavaScript
- Size: 244 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hapi-cache-stats
hapi-cache-stats is a library that monitors the ratio of hits:gets
for your server method caches. When a method's ratios fall below a given threshold
it will log the hit:get ratio and the stale:get ratio.## Installation
```console
npm install hapi-cache-stats
```## Usage
```js
await server.register({
plugin: require('hapi-cache-stats'),
options: {
interval: 500,
threshold: 0.5
}
});
```And every server method that has cahcing enabled will be polled every 500 milliseconds,
if the ratio of hits:gets drops below _threshold_ it will notify you via server.log.## options
- __interval__
Report rate in milliseconds, default is 60000.
- __verbose__
Set to true to log the hit:get and also the stale:get ratio every round.
- __threshold__
Threshold as a value between 0.0 and 1.0. When the hit:get ratio drops below this
thresold hapi-cache-stats will announce it via server.log.