Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getOrCreateMeter(name, dimensions, publishingIntervalInSeconds) {
// todo validate options
let meter;
if (this._registry.hasMetric(name, dimensions)) {
meter = this._registry.getMetric(name, dimensions);
} else {
meter = new Meter();
const key = this._registry.putMetric(name, meter, dimensions);
this._reporters.forEach(reporter => reporter.reportMetricOnInterval(key, publishingIntervalInSeconds));
}
return meter;
}