container.ts
Version:
Modular application framework
36 lines • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/** Metric types supported by StatsD. */
var EMetricType;
(function (EMetricType) {
EMetricType[EMetricType["Increment"] = 0] = "Increment";
EMetricType[EMetricType["Decrement"] = 1] = "Decrement";
EMetricType[EMetricType["Gauge"] = 2] = "Gauge";
EMetricType[EMetricType["Timing"] = 3] = "Timing";
EMetricType[EMetricType["Histogram"] = 4] = "Histogram";
})(EMetricType = exports.EMetricType || (exports.EMetricType = {}));
/** Abstract metric class. */
class Metric {
/** Send i counter metric. */
increment(name, value = 1, tags = {}) {
return this.metric(EMetricType.Increment, name, value, tags);
}
/** Send decrement counter metric. */
decrement(name, value = -1, tags = {}) {
return this.metric(EMetricType.Decrement, name, value, tags);
}
/** Send value metric. */
gauge(name, value, tags = {}) {
return this.metric(EMetricType.Gauge, name, value, tags);
}
/** Send time metric in milliseconds. */
timing(name, value, tags = {}) {
return this.metric(EMetricType.Timing, name, value, tags);
}
/** Send distribution value metric. */
histogram(name, value, tags = {}) {
return this.metric(EMetricType.Histogram, name, value, tags);
}
}
exports.Metric = Metric;
//# sourceMappingURL=Metric.js.map