Remove Error handling stuff for now

This commit is contained in:
Dan Rowe 2012-11-01 22:44:39 -04:00
Родитель 4530718f40
Коммит 00c0c1fa8c
3 изменённых файлов: 7 добавлений и 19 удалений

Просмотреть файл

@ -2,7 +2,6 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
var key; var key;
var counter_rates = {}; var counter_rates = {};
var timer_data = {}; var timer_data = {};
var error = false;
var counters = metrics.counters; var counters = metrics.counters;
var timers = metrics.timers; var timers = metrics.timers;
var pctThreshold = metrics.pctThreshold; var pctThreshold = metrics.pctThreshold;
@ -80,11 +79,7 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
metrics.counter_rates = counter_rates; metrics.counter_rates = counter_rates;
metrics.timer_data = timer_data; metrics.timer_data = timer_data;
if (Object.keys(counter_rates).length == 0 && Object.keys(timer_data).length == 0 ) { flushCallback(metrics);
error = "no metrics to calculate";
}
flushCallback(error, metrics);
} }
exports.process_metrics = process_metrics exports.process_metrics = process_metrics

Просмотреть файл

@ -13,8 +13,7 @@ var dgram = require('dgram')
var keyCounter = {}; var keyCounter = {};
var counters = { var counters = {
"statsd.packets_received": 0, "statsd.packets_received": 0,
"statsd.bad_lines_seen": 0, "statsd.bad_lines_seen": 0
"statsd.calculation_error": 0
}; };
var timers = {}; var timers = {};
var gauges = {}; var gauges = {};
@ -73,12 +72,7 @@ function flushMetrics() {
} }
}); });
pm.process_metrics(metrics_hash, flushInterval, time_stamp, function emitFlush(err, metrics) { pm.process_metrics(metrics_hash, flushInterval, time_stamp, function emitFlush(metrics) {
if (err) {
l.log("Calculation Error: " + err);
counters["statsd.calculation_error"]++;
stats['messages']['calculation_error']++;
}
backendEvents.emit('flush', time_stamp, metrics); backendEvents.emit('flush', time_stamp, metrics);
}); });
@ -87,8 +81,7 @@ function flushMetrics() {
var stats = { var stats = {
messages: { messages: {
last_msg_seen: startup_time, last_msg_seen: startup_time,
bad_lines_seen: 0, bad_lines_seen: 0
calculation_error: 0
} }
}; };

Просмотреть файл

@ -149,7 +149,7 @@ module.exports = {
return data; return data;
}); });
test.ok(_.include(_.map(entries,function(x) { return _.keys(x)[0] }),'statsd.numStats'),'graphite output includes numStats'); 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(); test.done();
}); });
}); });
@ -205,9 +205,9 @@ module.exports = {
}); });
var numstat_test = function(post){ var numstat_test = function(post){
var mykey = 'statsd.numStats'; 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 testavgvalue_test = function(post){
var mykey = 'stats.a_test_value'; var mykey = 'stats.a_test_value';