UNPKG

vulcain-corejs

Version:
28 lines 984 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const system_1 = require("../../globals/system"); /** * Metrics adapter for testing * Emit metrics on console * * @export * @class ConsoleMetrics */ class ConsoleMetrics { constructor(address) { this.tags = ",env=" + system_1.Service.environment + ",service=" + system_1.Service.serviceName + ',version=' + system_1.Service.serviceVersion; } log(msg) { } gauge(metric, customTags, delta) { this.log(`METRICS: gauge ${metric + this.tags + customTags} : ${delta || 1}`); } count(metric, customTags, delta) { this.log(`METRICS: counter ${metric + this.tags + customTags} : ${delta || 1}`); } timing(metric, duration, customTags) { this.log(`METRICS: timing ${metric + this.tags + customTags} : ${duration}ms`); } } exports.ConsoleMetrics = ConsoleMetrics; //# sourceMappingURL=consoleMetrics.js.map