/** * Add a new {@link ContextAwareReporter} to the {@link RootMetricContext} for it to manage. * @param reporter {@link ContextAwareReporter} to manage. */ public void addNewReporter(ContextAwareReporter reporter) { this.reporters.add(this.closer.register(reporter)); if (this.reportingStarted) { reporter.start(); } }
/** * Start all {@link ContextAwareReporter}s managed by the {@link RootMetricContext}. */ public void startReporting() { this.reportingStarted = true; for (ContextAwareReporter reporter : this.reporters) { try { reporter.start(); } catch (Throwable throwable) { log.error(String.format("Failed to start reporter with class %s", reporter.getClass().getCanonicalName()), throwable); } } }
/** * Add a new {@link ContextAwareReporter} to the {@link RootMetricContext} for it to manage. * @param reporter {@link ContextAwareReporter} to manage. */ public void addNewReporter(ContextAwareReporter reporter) { this.reporters.add(this.closer.register(reporter)); if (this.reportingStarted) { reporter.start(); } }
/** * Start all {@link ContextAwareReporter}s managed by the {@link RootMetricContext}. */ public void startReporting() { this.reportingStarted = true; for (ContextAwareReporter reporter : this.reporters) { try { reporter.start(); } catch (Throwable throwable) { log.error(String.format("Failed to start reporter with class %s", reporter.getClass().getCanonicalName()), throwable); } } }