private void buildJmxMetricReporter(Properties properties) { if (!Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_JMX_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_JMX_ENABLED))) { return; } LOGGER.info("Reporting metrics to JMX"); this.jmxReporter = Optional.of(codahaleReportersCloser.register(JmxReporter.forRegistry(RootMetricContext.get()). convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build())); }
JmxReporter reporter = JmxReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start();
final JmxReporter jmxReporter = JmxReporter.forRegistry(config.metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); jmxReporter.start();
public void init() { Builder builder = JmxReporter.forRegistry(registry).registerWith( ManagementFactory.getPlatformMBeanServer()); if (domain != null) { builder.inDomain(domain); } builder.convertRatesTo(TimeUnit.SECONDS); builder.convertDurationsTo(TimeUnit.MILLISECONDS); builder.filter(MetricFilter.ALL); reporter = builder.build(); reporter.start(); }
public JmxPublisher(MetricRegistry metricRegistry, TimeUnit reportedRatesTimeUnit, TimeUnit reportedDurationsTimeUnit, MetricFilter metricFilter) { jmxReporter = JmxReporter .forRegistry(metricRegistry) .convertRatesTo(reportedRatesTimeUnit) .convertDurationsTo(reportedDurationsTimeUnit) .filter(metricFilter) .build(); }
public JmxReporterImpl(MetricRegistry metricRegistry, MetricFilter metricFilter, String domain) { super("JMX"); this.jmxReporter = JmxReporter.forRegistry(metricRegistry).inDomain(domain).filter(metricFilter) .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build(); }
public static DropwizardRequestMetrics withDefaultMBeans(MetricRegistry registry) { DefaultMetricNamer metricNamer = new DefaultMetricNamer(); final JmxReporter jmxReporter = JmxReporter.forRegistry(registry) .filter(metricNamer) .createsObjectNamesWith(metricNamer) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); jmxReporter.start(); return new DropwizardRequestMetrics(registry, metricNamer); }
@Override public void configureReporters(MetricRegistry metricRegistry) { JmxReporter.forRegistry(metricRegistry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build() .start(); } }
public Metrics(Config config) { this.reporter = Slf4jReporter.forRegistry(metrics).outputTo(logger).convertDurationsTo(TimeUnit.MILLISECONDS) .convertRatesTo(TimeUnit.SECONDS).build(); reporter.start(1, TimeUnit.MINUTES); this.jmxReporter = JmxReporter.forRegistry(metrics).inDomain("HeftyDB @ " + config.tableDirectory().toString ()).convertDurationsTo(TimeUnit.MILLISECONDS).convertRatesTo(TimeUnit.SECONDS).build(); jmxReporter.start(); initMetrics(); }
public JmxMetricsReporter(MetricRegistry registry, KylinConfig conf) { this.registry = registry; this.conf = conf; jmxReporter = JmxReporter.forRegistry(registry).convertRatesTo(TimeUnit.SECONDS) .createsObjectNamesWith(new KylinObjectNameFactory()).convertDurationsTo(TimeUnit.MILLISECONDS).build(); }
private void enableJmxSupport() { final Builder builder = JmxReporter.forRegistry(this.metricRegistry); builder.convertDurationsTo(TimeUnit.MILLISECONDS); builder.convertRatesTo(TimeUnit.SECONDS); builder.inDomain("org.eclipse.kapua"); this.jmxReporter = builder.build(); this.jmxReporter.start(); /* * As Kapua services don't have any proper lifecycle management we can only * start the reporter but never stop it. */ }
private void buildJmxMetricReporter(Properties properties) { if (!Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_JMX_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_JMX_ENABLED))) { return; } LOGGER.info("Reporting metrics to JMX"); this.jmxReporter = Optional.of(codahaleReportersCloser.register(JmxReporter.forRegistry(RootMetricContext.get()). convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build())); }
public JmxMetricsReporter(MetricRegistry registry, HiveConf conf) { this.registry = registry; this.conf = conf; jmxReporter = JmxReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); }
private void enableJmxSupport() { final Builder builder = JmxReporter.forRegistry(this.metricRegistry); builder.convertDurationsTo(TimeUnit.MILLISECONDS); builder.convertRatesTo(TimeUnit.SECONDS); builder.inDomain("org.eclipse.kapua"); this.jmxReporter = builder.build(); this.jmxReporter.start(); /* * As Kapua services don't have any proper lifecycle management we can only * start the reporter but never stop it. */ }
private void buildJmxMetricReporter(Properties properties) { if (!Boolean.valueOf(properties.getProperty(ConfigurationKeys.METRICS_REPORTING_JMX_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_JMX_ENABLED))) { return; } LOGGER.info("Reporting metrics to JMX"); this.jmxReporter = Optional.of(codahaleReportersCloser.register(JmxReporter.forRegistry(RootMetricContext.get()). convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).build())); }
private static void setupJmxReporting(MetricRegistry metrics) { if (!metricsJmxReportingEnabled) return; // This filters noisy addressSpace metrics to have a clean JMX reporting JmxReporter jmxReporter = JmxReporter.forRegistry(metrics) .convertDurationsTo(TimeUnit.MICROSECONDS) .convertRatesTo(TimeUnit.SECONDS) .inDomain(CORFU_METRICS) .filter(ADDRESS_SPACE_FILTER) .build(); jmxReporter.start(); }
@Override protected JmxReporter createInstance() { final JmxReporter.Builder reporter = JmxReporter.forRegistry(getMetricRegistry()); if (hasProperty(DOMAIN)) { reporter.inDomain(getProperty(DOMAIN)); } if (hasProperty(DURATION_UNIT)) { reporter.convertDurationsTo(getProperty(DURATION_UNIT, TimeUnit.class)); } if (hasProperty(RATE_UNIT)) { reporter.convertRatesTo(getProperty(RATE_UNIT, TimeUnit.class)); } reporter.filter(getMetricFilter()); if (hasProperty(MBEAN_SERVER_REF)) { reporter.registerWith(getPropertyRef(MBEAN_SERVER_REF, MBeanServer.class)); } return reporter.build(); }
@Override public void prepare(MetricRegistry metricsRegistry, Map<String, Object> stormConf, Map<String, Object> reporterConf) { LOG.info("Preparing..."); JmxReporter.Builder builder = JmxReporter.forRegistry(metricsRegistry); TimeUnit durationUnit = ClientMetricsUtils.getMetricsDurationUnit(reporterConf); if (durationUnit != null) { builder.convertDurationsTo(durationUnit); } TimeUnit rateUnit = ClientMetricsUtils.getMetricsRateUnit(reporterConf); if (rateUnit != null) { builder.convertRatesTo(rateUnit); } String domain = getMetricsJmxDomain(reporterConf); if (domain != null) { builder.inDomain(domain); } StormMetricsFilter filter = ScheduledStormReporter.getMetricsFilter(reporterConf); if (filter != null) { builder.filter(filter); } // other builder functions not exposed: // * createsObjectNamesWith(ObjectNameFactory onFactory) // * registerWith (MBeanServer) // * specificDurationUnits (Map<String,TimeUnit> specificDurationUnits) // * specificRateUnits(Map<String,TimeUnit> specificRateUnits) reporter = builder.build(); }
public JmxMetricsReporter(MetricRegistry registry, HiveConf conf) { this.registry = registry; this.conf = conf; jmxReporter = JmxReporter.forRegistry(registry) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); }
public JmxMetricsReporter(MetricRegistry registry, KylinConfig conf) { this.registry = registry; this.conf = conf; jmxReporter = JmxReporter.forRegistry(registry).convertRatesTo(TimeUnit.SECONDS) .createsObjectNamesWith(new KylinObjectNameFactory()).convertDurationsTo(TimeUnit.MILLISECONDS).build(); }