public MetricsImpl(final MetricRegistry registry, final Type type) { // MasterMetrics is only for masters, and SupervisorMetrics only for agents this.masterMetrics = type == Type.MASTER ? new MasterMetricsImpl(GROUP, registry) : new NoopMasterMetrics(); this.supervisorMetrics = type == Type.AGENT ? new SupervisorMetricsImpl(GROUP, registry) : new NoopSupervisorMetrics(); this.zooKeeperMetrics = new ZooKeeperMetricsImpl(GROUP, registry); this.jmxReporter = JmxReporter.forRegistry(registry).build(); }
public MetricsImpl(final MetricRegistry registry) { this.masterMetrics = new MasterMetricsImpl(GROUP, registry); this.supervisorMetrics = new SupervisorMetricsImpl(GROUP, registry); this.zooKeeperMetrics = new ZooKeeperMetricsImpl(GROUP, registry); this.jmxReporter = JmxReporter.forRegistry(registry).build(); }