Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getOrCreateTimer(name, dimensions, publishingIntervalInSeconds) {
validateTimerOptions(name, dimensions, publishingIntervalInSeconds);
let timer;
if (this._registry.hasMetric(name, dimensions)) {
timer = this._registry.getMetric(name, dimensions);
} else {
timer = new Timer({ meter: new NoOpMeter() });
const key = this._registry.putMetric(name, timer, dimensions);
this._reporters.forEach(reporter => reporter.reportMetricOnInterval(key, publishingIntervalInSeconds));
}
return timer;
}
getOrCreateMeter(name, dimensions, publishingIntervalInSeconds) {
this._log.error(
'Meters will not get reported using the SignalFx reporter as they waste DPM, please use a counter instead'
);
return new NoOpMeter();
}