@Override public void onMetricsRegistryRegistered(MetricsRegistry metricsRegistry) { new JmxReporter(metricsRegistry).start(); } }
@Override public void onTrigger(final ReportingContext context) { final ProcessGroupStatus rootGroupStatus = context.getEventAccess().getControllerStatus(); this.latestStatus.set(rootGroupStatus); gangliaReporter.run(); getLogger().info("{} Sent metrics to Ganglia", new Object[] {this}); }
ConsoleReporter reporter = new ConsoleReporter( Metrics.defaultRegistry(), System.out, MetricPredicate.ALL ); reporter.run();
public AdminServlet(HealthCheckServlet healthCheckServlet, MetricsServlet metricsServlet, PingServlet pingServlet, ThreadDumpServlet threadDumpServlet, String healthcheckUri, String metricsUri, String pingUri, String threadsUri) { this.healthCheckServlet = healthCheckServlet; this.metricsServlet = metricsServlet; this.pingServlet = pingServlet; this.threadDumpServlet = threadDumpServlet; this.metricsUri = metricsUri; this.pingUri = pingUri; this.threadsUri = threadsUri; this.healthcheckUri = healthcheckUri; }
/** * Enables the CSV reporter for the given metrics registry, and causes it to write to files in * {@code outputDir} with the specified period. * * @param metricsRegistry the metrics registry * @param outputDir the directory in which {@code .csv} files will be created * @param period the period between successive outputs * @param unit the time unit of {@code period} */ public static void enable(MetricsRegistry metricsRegistry, File outputDir, long period, TimeUnit unit) { final CsvReporter reporter = new CsvReporter(metricsRegistry, outputDir); reporter.start(period, unit); }
@Override public void processGauge(MetricName name, com.yammer.metrics.core.Gauge<?> gauge, Context context) throws Exception { registerBean(context.getMetricName(), new Gauge(gauge, context.getObjectName()), context.getObjectName()); }
@Override public void processMeter(MetricName name, Metered meter, Context context) throws Exception { registerBean(context.getMetricName(), new Meter(meter, context.getObjectName()), context.getObjectName()); }
@Override public void processHistogram(MetricName name, com.yammer.metrics.core.Histogram histogram, Context context) throws Exception { registerBean(context.getMetricName(), new Histogram(histogram, context.getObjectName()), context.getObjectName()); }
@Override public void processCounter(MetricName name, com.yammer.metrics.core.Counter counter, Context context) throws Exception { registerBean(context.getMetricName(), new Counter(counter, context.getObjectName()), context.getObjectName()); }
@Override public void processTimer(MetricName name, com.yammer.metrics.core.Timer timer, Context context) throws Exception { registerBean(context.getMetricName(), new Timer(timer, context.getObjectName()), context.getObjectName()); }
@Override public void processTimer(MetricName name, Timer timer, Long epoch) throws IOException { processMeter(name, timer, epoch); final String sanitizedName = sanitizeName(name); sendSummarizable(epoch, sanitizedName, timer); sendSampling(epoch, sanitizedName, timer); }
@Override public void processHistogram(MetricName name, Histogram histogram, Long epoch) throws IOException { final String sanitizedName = sanitizeName(name); sendSummarizable(epoch, sanitizedName, histogram); sendSampling(epoch, sanitizedName, histogram); }
public void processTimer(MetricName name, Timer timer, Long epoch) throws Exception { processMeter(name, timer, epoch); pushSummarizable(name, timer, epoch); pushSampling(name, timer, epoch); }
/** * Enables the graphite reporter to send data for the given metrics registry to graphite server * with the specified period. * * @param metricsRegistry the metrics registry * @param period the period between successive outputs * @param unit the time unit of {@code period} * @param host the host name of graphite server (carbon-cache agent) * @param port the port number on which the graphite server is listening */ public static void enable(MetricsRegistry metricsRegistry, long period, TimeUnit unit, String host, int port) { enable(metricsRegistry, period, unit, host, port, null); }
public static void enableForEc2Instance(long period, TimeUnit unit, String apiKey) throws IOException { String hostName = AwsHelper.getEc2InstanceId(); DatadogReporter dd = new DatadogReporter(Metrics.defaultRegistry(), apiKey, hostName); dd.start(period, unit); }
/** * Stops the default instance of {@link JmxReporter}. */ public static void shutdownDefault() { if (INSTANCE != null) { INSTANCE.shutdown(); } }
public void processHistogram(MetricName name, Histogram histogram, Long epoch) throws Exception { pushSummarizable(name, histogram, epoch); pushSampling(name, histogram, epoch); }
public void run() { JmxReporter.shutdownDefault(); } };
/** * 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; }