@mojaloop/central-services-metrics
Advanced tools
Comparing version 12.3.0 to 12.4.0
@@ -82,2 +82,3 @@ /***** | ||
this._summaries = {}; | ||
this._counters = {}; | ||
/** | ||
@@ -159,2 +160,18 @@ * Setup the prom client for collecting metrics using the options passed | ||
}; | ||
this.getCounter = function (name, help, labelNames) { | ||
try { | ||
if (_this._counters[name] != null) { | ||
return _this._counters[name]; | ||
} | ||
_this._counters[name] = new client.Counter({ | ||
name: "".concat(_this.getOptions().prefix).concat(name), | ||
help: (help != null ? help : "".concat(name, "_counter")), | ||
labelNames: labelNames | ||
}); | ||
return _this._counters[name]; | ||
} | ||
catch (e) { | ||
throw new Error("Couldn't get counter for ".concat(name)); | ||
} | ||
}; | ||
/** | ||
@@ -161,0 +178,0 @@ * Get the metrics |
{ | ||
"name": "@mojaloop/central-services-metrics", | ||
"version": "12.3.0", | ||
"version": "12.4.0", | ||
"description": "Shared code for metrics generation", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
33236
340