@Override public void onMetricsRegistryRegistered(MetricsRegistry metricsRegistry) { new JmxReporter(metricsRegistry).start(); } }
@Override public JmxReporter get() { if (metricsRegistry == Metrics.defaultRegistry()) { return JmxReporter.getDefault(); } final JmxReporter reporter = new JmxReporter(metricsRegistry); reporter.start(); return reporter; } }
/** * Create registry with group to use for metrics. * * @param groupName String group to use for metrics. * @param type String type to use for metrics. * @return new metrics registry */ public static GiraphMetricsRegistry createWithOptional(String groupName, String type) { MetricsRegistry registry = new MetricsRegistry(); return new GiraphMetricsRegistry(registry, new JmxReporter(registry), groupName, type); }
/** * Constructor * @param registry {@link MetricsRegistry} to use * @param reporter {@link JmxReporter} to use * @param groupName String grouping for metrics * @param type String type name for metrics */ protected GiraphMetricsRegistry(MetricsRegistry registry, JmxReporter reporter, String groupName, String type) { this.registry = registry; this.jmxReporter = reporter; this.groupName = groupName; this.type = type; if (jmxReporter != null) { jmxReporter.start(); } }
/** * Stops the default instance of {@link JmxReporter}. */ public static void shutdownDefault() { if (INSTANCE != null) { INSTANCE.shutdown(); } }
@Override public void shutdown() { getMetricsRegistry().removeListener(this); for (ObjectName name : registeredBeans.values()) { unregisterBean(name); } registeredBeans.clear(); }
/** * Starts the reporter. */ public final void start() { getMetricsRegistry().addListener(this); }
/** * Create with Hadoop Configuration and superstep number. * * @param conf Hadoop Configuration to use. * @param superstep number of superstep to use as group for metrics. * @return new metrics registry */ public static SuperstepMetricsRegistry create(GiraphConfiguration conf, long superstep) { if (conf.metricsEnabled()) { MetricsRegistry registry = new MetricsRegistry(); SuperstepMetricsRegistry superstepMetrics = new SuperstepMetricsRegistry( registry, new JmxReporter(registry), "giraph.superstep", String.valueOf(superstep)); superstepMetrics.superstep = superstep; return superstepMetrics; } else { return createFake(); } }
public void shutdown() { this.reporter.shutdown(); this.registry.shutdown(); }
/** * Starts the default instance of {@link JmxReporter}. * * @param registry the {@link MetricsRegistry} to report from */ public static void startDefault(MetricsRegistry registry) { INSTANCE = new JmxReporter(registry); INSTANCE.start(); }
public static JmxReporter createInstance(MetricsRegistry metrics) { final JmxReporter reporter = new JmxReporter(metrics); reporter.start(); return reporter; }
synchronized (jmxSetupLock) { if(!jmxSetupDone) { new JmxReporter(regionTimers).start(); new JmxReporter(serverTimers).start(); new JmxReporter(opTypeTimers).start(); jmxSetupDone = true;
this.runnerStats = new RunnerStats(this.registry); this.reporter = new JmxReporter(this.registry); this.reporter.start();