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:
Patrick McCoy 2012-11-01 12:59:12 -06:00
Родитель 71df1bdb6b
Коммит 777ea8c957
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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