From dcf0620da1ba3492a4b7decd063fcf31ce365cb9 Mon Sep 17 00:00:00 2001 From: draco2003 Date: Sat, 2 Mar 2013 00:19:33 +0000 Subject: [PATCH] remove duplicate code, and fix global leak --- backends/graphite.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backends/graphite.js b/backends/graphite.js index 79aca15..46cacd7 100644 --- a/backends/graphite.js +++ b/backends/graphite.js @@ -110,8 +110,6 @@ var flush_stats = function graphite_flush(ts, metrics) { } for (key in timer_data) { - var namespace = timerNamespace.concat(key); - var the_key = namespace.join("."); for (timer_data_key in timer_data[key]) { var namespace = timerNamespace.concat(key); var the_key = namespace.join("."); @@ -119,7 +117,7 @@ var flush_stats = function graphite_flush(ts, metrics) { 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]) { + for (var 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;