Skip to content

Commit

Permalink
fix graphite output to conform to etsy output
Browse files Browse the repository at this point in the history
  • Loading branch information
wickedchicken committed Jan 17, 2012
1 parent 50e90ba commit 97dd43c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions stats.js
Expand Up @@ -262,9 +262,13 @@ config.configFile(process.argv[2], function (config, oldConfig) {
for (k in stats[type]){
var stat = stats[type][k];
if (type == "counters"){
var per_interval_value = stat["value"] / (flushInterval / 1000);
stats_str += ('stats.' + k + ' ' + per_interval_value + ' ' + ts + "\n");
stats_str += ('stats_counts.' + k + ' ' + stat["value"] + ' ' + ts + "\n");
if(k == 'numStats'){
stats_str += 'statsd.numStats ' + stat['value'] + ' ' + ts + "\n";
} else {
var per_interval_value = stat["value"] / (flushInterval / 1000);
stats_str += ('stats.' + k + ' ' + per_interval_value + ' ' + ts + "\n");
stats_str += ('stats_counts.' + k + ' ' + stat["value"] + ' ' + ts + "\n");
}
} else {
for (s in stat){
stats_str += ('stats.timers.' + k + '.' + s + ' ' + stat[s] + ' ' + ts + "\n");
Expand Down

0 comments on commit 97dd43c

Please sign in to comment.