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