Skip to content

Commit

Permalink
Add an error parameter to the stats write callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
mheffner committed Apr 26, 2012
1 parent a376106 commit 168a8af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backends/graphite.js
Expand Up @@ -121,7 +121,7 @@ var flush_stats = function(ts, flushInterval, metrics) {

var write_stats = function(writeCb) {
for (stat in graphiteStats) {
writeCb(stat, graphiteStats[stat]);
writeCb(null, stat, graphiteStats[stat]);
}
};

Expand Down
9 changes: 7 additions & 2 deletions stats.js
Expand Up @@ -176,8 +176,13 @@ config.configFile(process.argv[2], function (config, oldConfig) {

// Retrieve stats from each backend
for (var i = 0; i < backends.length; i++) {
backends[i].mod.write_stats(function(stat, val) {
stat_writer(backends[i].name, stat, val);
backends[i].mod.write_stats(function(err, stat, val) {
if (err) {
util.log("Failed to read stats for backend " +
backends[i].name + ": " + err);
} else {
stat_writer(backends[i].name, stat, val);
}
});
}

Expand Down

0 comments on commit 168a8af

Please sign in to comment.