public ContextAwareReporter(String name, Config config) { this.name = name; this.config = config; this.started = false; RootMetricContext.get().addNewReporter(this); this.notificationTargetUUID = RootMetricContext.get().addNotificationTarget(new Function<Notification, Void>() { @Nullable @Override public Void apply(Notification input) { notificationCallback(input); return null; } }); this.contextFilter = ContextFilterFactory.createContextFilter(config); this.contextsToReport = Sets.newConcurrentHashSet(); for (MetricContext context : this.contextFilter.getMatchingContexts()) { this.contextsToReport.add(context.getInnerMetricContext()); } }
public ContextAwareReporter(String name, Config config) { this.name = name; this.config = config; this.started = false; RootMetricContext.get().addNewReporter(this); this.notificationTargetUUID = RootMetricContext.get().addNotificationTarget(new Function<Notification, Void>() { @Nullable @Override public Void apply(Notification input) { notificationCallback(input); return null; } }); this.contextFilter = ContextFilterFactory.createContextFilter(config); this.contextsToReport = Sets.newConcurrentHashSet(); for (MetricContext context : this.contextFilter.getMatchingContexts()) { this.contextsToReport.add(context.getInnerMetricContext()); } }