зеркало из https://github.com/microsoft/statsd.git
Update stats.js
Added a config option delete_counters with a default: false to control the behavior of the counters metrics to delete.
This commit is contained in:
Родитель
71df1bdb6b
Коммит
777ea8c957
7
stats.js
7
stats.js
|
@ -51,8 +51,13 @@ function flushMetrics() {
|
|||
// After all listeners, reset the stats
|
||||
backendEvents.once('flush', function clear_metrics(ts, metrics) {
|
||||
// Clear the counters
|
||||
config.delete_counters = config.delete_counters || false;
|
||||
for (key in metrics.counters) {
|
||||
metrics.counters[key] = undefined;
|
||||
if (config.delete_counters) {
|
||||
metrics.counters[key] = undefined;
|
||||
} else {
|
||||
metrics.counters[key] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the timers
|
||||
|
|
Загрузка…
Ссылка в новой задаче