Tabnine Logo
JmxReporter$Builder
Code IndexAdd Tabnine to your IDE (free)

How to use
JmxReporter$Builder
in
com.codahale.metrics

Best Java code snippets using com.codahale.metrics.JmxReporter$Builder (Showing top 20 results out of 1,116)

Refine searchRefine arrow

  • JmxReporter
origin: stagemonitor/stagemonitor

private void reportToJMX(MetricRegistry metricRegistry) {
  final JmxReporter reporter = JmxReporter.forRegistry(metricRegistry).build();
  reporter.start();
  reporters.add(reporter);
}
origin: apache/storm

@Override
public void prepare(MetricRegistry metricsRegistry, Map<String, Object> topoConf) {
  LOG.info("Preparing...");
  JmxReporter.Builder builder = JmxReporter.forRegistry(metricsRegistry);
  String domain = ObjectReader.getString(topoConf.get(DaemonConfig.STORM_DAEMON_METRICS_REPORTER_PLUGIN_DOMAIN), null);
  if (domain != null) {
    builder.inDomain(domain);
  }
  TimeUnit rateUnit = ClientMetricsUtils.getMetricsRateUnit(topoConf);
  if (rateUnit != null) {
    builder.convertRatesTo(rateUnit);
  }
  reporter = builder.build();
}
origin: apache/incubator-gobblin

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()));
}
origin: thinkaurelius/titan

JmxReporter.Builder b = JmxReporter.forRegistry(getRegistry());
  b.inDomain(domain);
  List<MBeanServer> servs = MBeanServerFactory.findMBeanServer(agentId);
  if (null != servs && 1 == servs.size()) {
    b.registerWith(servs.get(0));
  } else {
    log.error("Metrics Slf4jReporter agentId {} does not resolve to a single MBeanServer", agentId);
jmxReporter = b.build();
jmxReporter.start();
origin: Alluxio/alluxio

/**
 * Creates a new {@link JmxSink} with a {@link Properties} and {@link MetricRegistry}.
 *
 * @param properties the properties
 * @param registry the metric registry to register
 */
public JmxSink(Properties properties, MetricRegistry registry) {
 mReporter = JmxReporter.forRegistry(registry).build();
}
origin: JanusGraph/janusgraph

JmxReporter.Builder b = JmxReporter.forRegistry(getRegistry());
  b.inDomain(domain);
  List<MBeanServer> servers = MBeanServerFactory.findMBeanServer(agentId);
  if (null != servers && 1 == servers.size()) {
    b.registerWith(servers.get(0));
  } else {
    log.error("Metrics Slf4jReporter agentId {} does not resolve to a single MBeanServer", agentId);
jmxReporter = b.build();
jmxReporter.start();
origin: apache/hbase

 "numActionsPerServer", scope));
this.reporter = JmxReporter.forRegistry(this.registry).build();
this.reporter.start();
origin: apache/hive

public JmxMetricsReporter(MetricRegistry registry, HiveConf conf) {
 this.registry = registry;
 this.conf = conf;
 jmxReporter = JmxReporter.forRegistry(registry)
   .convertRatesTo(TimeUnit.SECONDS)
   .convertDurationsTo(TimeUnit.MILLISECONDS)
   .build();
}
origin: apache/usergrid

@Inject
public MetricsFactoryImpl(MetricsFig metricsFig) {
  registry = new MetricRegistry();
  String metricsHost = metricsFig.getHost();
  if (!metricsHost.equals("false")) {
    Graphite graphite = new Graphite(new InetSocketAddress(metricsHost, 2003));
    graphiteReporter = GraphiteReporter.forRegistry(registry).prefixedWith("usergrid-metrics")
      .convertRatesTo(TimeUnit.SECONDS)
      .convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL)
      .build(graphite);
    graphiteReporter.start(30, TimeUnit.SECONDS);
  } else {
    logger.warn("MetricsService:Logger not started.");
  }
  jmxReporter = JmxReporter.forRegistry(registry).build();
  jmxReporter.start();
}
origin: apache/kylin

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();
}
origin: kaaproject/kaa

@Override
public void startReport() {
 LOG.info("Starting metrics report!");
 reporter = Slf4jReporter.forRegistry(metrics)
   .outputTo(LoggerFactory.getLogger(KAA_METRICS_LOGGER_NAME))
   .convertRatesTo(TimeUnit.SECONDS)
   .convertDurationsTo(TimeUnit.MILLISECONDS).build();
 registerSystemMonitor();
 reporter.start(30, TimeUnit.SECONDS);
 this.jmx = JmxReporter.forRegistry(this.metrics).inDomain(KAA_METRICS_LOGGER_NAME).build();
 this.jmx.start();
}
origin: apache/storm

@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();
}
origin: linkedin/cruise-control

JmxReporter jmxReporter = JmxReporter.forRegistry(dropwizardMetricsRegistry).inDomain(METRIC_DOMAIN).build();
jmxReporter.start();
origin: spotify/helios

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();
}
origin: apache/hive

 scheduledReporters.add(reporter);
} else if (reporterName.equals("jmx") || reporterName.endsWith("jmxmetricsreporter")) {
 JmxReporter reporter = JmxReporter.forRegistry(registry)
   .convertRatesTo(TimeUnit.SECONDS)
   .convertDurationsTo(TimeUnit.MILLISECONDS)
   .build();
 reporter.start();
 reporters.add(reporter);
} else if (reporterName.startsWith("json") || reporterName.endsWith("jsonfilemetricsreporter")) {
origin: apache/james-project

@Inject
public DropWizardMetricFactory(MetricRegistry metricRegistry) {
  this.metricRegistry = metricRegistry;
  this.jmxReporter = JmxReporter.forRegistry(metricRegistry)
    .build();
}
origin: ninjaframework/ninja

JmxReporter reporter = JmxReporter.forRegistry(metricRegistry)
    .inDomain(applicationName).build();
reporter.start();
origin: org.apache.gobblin/gobblin-metrics

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()));
}
origin: zendesk/maxwell

final JmxReporter jmxReporter = JmxReporter.forRegistry(config.metricRegistry)
    .convertRatesTo(TimeUnit.SECONDS)
    .convertDurationsTo(TimeUnit.MILLISECONDS)
    .build();
jmxReporter.start();
LOGGER.info("JMX metrics reporter enabled");
origin: com.linkedin.gobblin/gobblin-metrics

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()));
}
com.codahale.metricsJmxReporter$Builder

Javadoc

A builder for CsvReporter instances. Defaults to using the default MBean server and not filtering metrics.

Most used methods

  • build
    Builds a JmxReporter with the given properties.
  • inDomain
  • convertRatesTo
    Convert rates to the given time unit.
  • convertDurationsTo
    Convert durations to the given time unit.
  • filter
    Only report metrics which match the given filter.
  • registerWith
    Register MBeans with the given MBeanServer.
  • createsObjectNamesWith
  • <init>
  • specificDurationUnits
    Use specific TimeUnits for the duration of the metrics with these names.
  • specificRateUnits
    Use specific TimeUnits for the rate of the metrics with these names.

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JTextField (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now