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
npm install hapi-cache-statsUsage
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.
On this page
Languages
JavaScript100.0%
MIT License
Created May 26, 2017
Updated March 9, 2021