Reset prometheus summaries for more accurate percentiles per 5 minutes

This commit is contained in:
Calvin Montgomery 2017-09-27 21:55:42 -07:00
parent 014f3f008e
commit a2be65aead
2 changed files with 8 additions and 0 deletions

View file

@ -19,6 +19,10 @@ const queryCount = new Counter({
help: 'DB query count'
});
setInterval(() => {
queryLatency.reset();
}, 5 * 60 * 1000).unref();
let db = null;
let globalBanDB = null;

View file

@ -58,6 +58,10 @@ function initPrometheus(app) {
});
next();
});
setInterval(() => {
latency.reset();
}, 5 * 60 * 1000).unref();
}
/**