unleash-server
Version:
Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.
31 lines • 953 B
JavaScript
import { CustomMetricsStore, } from './custom-metrics-store.js';
export class CustomMetricsService {
constructor(config) {
this.logger = config.getLogger('custom-metrics-service');
this.store = new CustomMetricsStore(config);
}
addMetric(metric) {
this.store.addMetric(metric);
}
addMetrics(metrics) {
this.store.addMetrics(metrics);
}
getMetrics() {
return this.store.getMetrics();
}
getMetricNames() {
return this.store.getMetricNames();
}
getPrometheusMetrics() {
return this.store.getPrometheusMetrics();
}
clearMetricsForTesting() {
if (this.store instanceof CustomMetricsStore) {
this.store.customMetricsStore = new Map();
}
else {
this.logger.warn('Cannot clear metrics - store is not an instance of CustomMetricsStore');
}
}
}
//# sourceMappingURL=custom-metrics-service.js.map