consul/agent/uiserver/dist/assets/metrics-providers/consul-5e97a9af114229497d43377450c54418.js
Andrew Stucki 040647e0ba
auto-updated agent/uiserver/dist/ from commit 63204b518 (#16587)
Co-authored-by: hc-github-team-consul-core <github-team-consul-core@hashicorp.com>
2023-03-09 13:56:53 -05:00

5 lines
632 B
JavaScript

(function(r){const e=["init","serviceRecentSummarySeries","serviceRecentSummaryStats","upstreamRecentSummaryStats","downstreamRecentSummaryStats"]
r.consul=new class{constructor(){this.registry={},this.providers={}}registerMetricsProvider(r,t){for(var i of e)if("function"!=typeof t[i])throw new Error(`Can't register metrics provider '${r}': missing ${i} method.`)
this.registry[r]=t}getMetricsProvider(r,e){if(!(r in this.registry))throw new Error(`Metrics Provider '${r}' is not registered.`)
return r in this.providers||(this.providers[r]=Object.create(this.registry[r]),this.providers[r].init(e)),this.providers[r]}}})(window)