make histograms work with the graphite backend

This commit is contained in:
Daniel Schauenberg 2013-02-19 15:22:14 -05:00
Родитель 3feedf2a44
Коммит f0a9361c2d
2 изменённых файлов: 4 добавлений и 3 удалений

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

@ -117,10 +117,11 @@ var flush_stats = function graphite_flush(ts, metrics) {
var namespace = timerNamespace.concat(key);
var the_key = namespace.join(".");
if (typeof(timer_data_key) === 'string') {
if (typeof(timer_data[key][timer_data_key]) === 'number') {
statString += the_key + '.' + timer_data_key + ' ' + timer_data[key][timer_data_key] + ts_suffix;
} else {
for (timer_data_sub_key in timer_data[key][timer_data_key]) {
l.log(timer_data[key][timer_data_key][timer_data_sub_key].toString());
statString += the_key + '.' + timer_data_key + '.' + timer_data_sub_key + ' ' +
timer_data[key][timer_data_key][timer_data_sub_key] + ts_suffix;
}

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

@ -54,7 +54,7 @@ function flushMetrics() {
counter_rates: counter_rates,
timer_data: timer_data,
pctThreshold: pctThreshold,
histogram: config.histogram
histogram: conf.histogram
}
// After all listeners, reset the stats
@ -124,7 +124,7 @@ config.configFile(process.argv[2], function (config, oldConfig) {
bad_lines_seen = prefixStats + ".bad_lines_seen";
packets_received = prefixStats + ".packets_received";
//now set to zero so we can increment them
//now set to zero so we can increment them
counters[bad_lines_seen] = 0;
counters[packets_received] = 0;