Permalink
Browse files

Remove Error handling stuff for now

  • Loading branch information...
1 parent 4530718 commit 00c0c1fa8cfa7a7354a74aaa77f65fc0f6e44ee5 @draco2003 committed Nov 2, 2012
Showing with 7 additions and 19 deletions.
  1. +1 −6 lib/process_metrics.js
  2. +3 −10 stats.js
  3. +3 −3 test/graphite_tests.js
View
@@ -2,7 +2,6 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
var key;
var counter_rates = {};
var timer_data = {};
- var error = false;
var counters = metrics.counters;
var timers = metrics.timers;
var pctThreshold = metrics.pctThreshold;
@@ -80,11 +79,7 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
metrics.counter_rates = counter_rates;
metrics.timer_data = timer_data;
- if (Object.keys(counter_rates).length == 0 && Object.keys(timer_data).length == 0 ) {
- error = "no metrics to calculate";
- }
-
- flushCallback(error, metrics);
+ flushCallback(metrics);
}
exports.process_metrics = process_metrics
View
@@ -13,8 +13,7 @@ var dgram = require('dgram')
var keyCounter = {};
var counters = {
"statsd.packets_received": 0,
- "statsd.bad_lines_seen": 0,
- "statsd.calculation_error": 0
+ "statsd.bad_lines_seen": 0
};
var timers = {};
var gauges = {};
@@ -73,12 +72,7 @@ function flushMetrics() {
}
});
- pm.process_metrics(metrics_hash, flushInterval, time_stamp, function emitFlush(err, metrics) {
- if (err) {
- l.log("Calculation Error: " + err);
- counters["statsd.calculation_error"]++;
- stats['messages']['calculation_error']++;
- }
+ pm.process_metrics(metrics_hash, flushInterval, time_stamp, function emitFlush(metrics) {
backendEvents.emit('flush', time_stamp, metrics);
});
@@ -87,8 +81,7 @@ function flushMetrics() {
var stats = {
messages: {
last_msg_seen: startup_time,
- bad_lines_seen: 0,
- calculation_error: 0
+ bad_lines_seen: 0
}
};
View
@@ -149,7 +149,7 @@ module.exports = {
return data;
});
test.ok(_.include(_.map(entries,function(x) { return _.keys(x)[0] }),'statsd.numStats'),'graphite output includes numStats');
- test.equal(_.find(entries, function(x) { return _.keys(x)[0] == 'statsd.numStats' })['statsd.numStats'],3);
+ test.equal(_.find(entries, function(x) { return _.keys(x)[0] == 'statsd.numStats' })['statsd.numStats'],2);
test.done();
});
});
@@ -205,9 +205,9 @@ module.exports = {
});
var numstat_test = function(post){
var mykey = 'statsd.numStats';
- return _.include(_.keys(post),mykey) && (post[mykey] == 4);
+ return _.include(_.keys(post),mykey) && (post[mykey] == 3);
};
- test.ok(_.any(hashes,numstat_test), 'statsd.numStats should be 1');
+ test.ok(_.any(hashes,numstat_test), 'statsd.numStats should be 3');
var testavgvalue_test = function(post){
var mykey = 'stats.a_test_value';

0 comments on commit 00c0c1f

Please sign in to comment.