dl
Version:
DreamLab Libs
26 lines (19 loc) • 526 B
JavaScript
var AbstractMetric = require('./AbstractMetric.js').AbstractMetric;
var CounterMetric = function () {
AbstractMetric.apply(this, arguments);
this._value = 0;
};
CounterMetric.prototype = Object.create(AbstractMetric.prototype);
CounterMetric.prototype.update = function () {
this._value++;
return this;
};
CounterMetric.prototype.dump = function () {
return [{
'key': this._name,
'value': {
'count': this._value
}
}];
};
exports.CounterMetric = CounterMetric;