Support of HTTP Node metrics

This commit is contained in:
Nick O'Leary
2015-02-04 20:44:07 +00:00
parent 86ca75bcd5
commit f2d4648384
3 changed files with 53 additions and 7 deletions

View File

@@ -201,7 +201,13 @@ Node.prototype.error = function(msg) {
log_helper(this, Log.ERROR, msg);
};
/**
* If called with no args, returns whether metric collection is enabled
*/
Node.prototype.metric = function(eventname, msg, metricValue) {
if (typeof eventname === "undefined") {
return Log.metric();
}
var metrics = {};
metrics.level = Log.METRIC;
metrics.nodeid = this.id;