Skip to content
Browse files

Lost the graphite changes in the rebase

  • Loading branch information...
1 parent 9fcb16b commit 85644fe72189488307da366637821f67d6e26169 @jeffminard-ck committed Jun 15, 2012
Showing with 22 additions and 1 deletion.
  1. +22 −1 backends/graphite.js
View
23 backends/graphite.js
@@ -51,8 +51,10 @@ var flush_stats = function graphite_flush(ts, metrics) {
var key;
var counters = metrics.counters;
- var gauges = metrics.gauges;
var timers = metrics.timers;
+ var gauges = metrics.gauges;
+ var raws = metrics.raws;
+ var averages = metrics.averages;
var pctThreshold = metrics.pctThreshold;
for (key in counters) {
@@ -116,6 +118,25 @@ var flush_stats = function graphite_flush(ts, metrics) {
numStats += 1;
}
+ for (key in raws) {
+ statString += 'stats.' + raws[key][0] + ' ' + raws[key][1] + ' ' + raws[key][2] + "\n";
+ numStats += 1;
+ }
+
+ for (key in averages) {
+ var vals = averages[key],
+ valCount = averages[key].length,
+ valTotal = 0;
+ if (vals.length >= 1) {
+ for (idx in vals) {
+ valTotal += vals[idx];
+ }
+ var averageVal = valTotal / valCount;
+ statString += 'stats.' + key + ' ' + averageVal + ' ' + ts + "\n";
+ numStats += 1;
+ }
+ }
+
statString += 'statsd.numStats ' + numStats + ' ' + ts + "\n";
post_stats(statString);
};

0 comments on commit 85644fe

Please sign in to comment.
Something went wrong with that request. Please try again.