pandora-metrics
Version:
## Overview
30 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const MetricsConstants_1 = require("../MetricsConstants");
const MetricName_1 = require("../common/MetricName");
/**
* @deprecated
*/
class MetricsProcessChannel {
static getInstance() {
if (!this.instance) {
this.instance = new MetricsProcessChannel();
}
return this.instance;
}
register(group, name, metric) {
name = this.buildName(name);
// register to real metrics manager
if (global[MetricsConstants_1.MetricsConstants.GLOBAL_METRICS_KEY] && global[MetricsConstants_1.MetricsConstants.GLOBAL_METRICS_KEY].register) {
global[MetricsConstants_1.MetricsConstants.GLOBAL_METRICS_KEY].register(group, name, metric);
}
}
buildName(name) {
if (typeof name === 'string') {
name = MetricName_1.MetricName.build(name);
}
return name;
}
}
exports.MetricsProcessChannel = MetricsProcessChannel;
//# sourceMappingURL=MetricsProcessChannel.js.map