Permalink
Browse files

Fixed re-setting stats.

Added commands to view+delete raws and averages (untested)
  • Loading branch information...
1 parent a9f05bc commit df0f34441d9cd4c5df67945b56a80299352982d5 Peter C. Norton committed with May 9, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 stats.js
View
@@ -37,6 +37,8 @@ function flushMetrics() {
var metrics_hash = {
counters: counters,
+ raws: raws,
+ averages: averages,
gauges: gauges,
timers: timers,
pctThreshold: pctThreshold
@@ -53,6 +55,8 @@ function flushMetrics() {
for (key in metrics.timers) {
metrics.timers[key] = [];
}
+ // Clear the raws
+ metrics.raws.length = 0
});
// Flush metrics to each backend.
@@ -207,6 +211,16 @@ config.configFile(process.argv[2], function (config, oldConfig) {
stream.write("END\n\n");
break;
+ case "raws":
+ stream.write(util.inspect(raws) + "\n");
+ stream.write("END\n\n");
+ break;
+
+ case "averages":
+ stream.write(util.inspect(averages) + "\n");
+ stream.write("END\n\n");
+ break;
+
case "gauges":
stream.write(util.inspect(gauges) + "\n");
stream.write("END\n\n");
@@ -228,6 +242,22 @@ config.configFile(process.argv[2], function (config, oldConfig) {
stream.write("END\n\n");
break;
+ case "delraws":
+ for (index in cmdline) {
+ delete raws[cmdline[index]];
+ stream.write("deleted: " + cmdline[index] + "\n");
+ }
+ stream.write("END\n\n");
+ break;
+
+ case "delaverages":
+ for (index in cmdline) {
+ delete averages[cmdline[index]];
+ stream.write("deleted: " + cmdline[index] + "\n");
+ }
+ stream.write("END\n\n");
+ break;
+
case "delgauges":
for (index in cmdline) {
delete gauges[cmdline[index]];

0 comments on commit df0f344

Please sign in to comment.