Package com.codahale.metrics

Examples of com.codahale.metrics.ScheduledReporter


import com.codahale.metrics.ScheduledReporter;

public class SendToLocalInfluxDB {

  public static void main(String[] args) {
    ScheduledReporter r0 = null;
    ScheduledReporter r1 = null;
    try {
      final MetricRegistry registry = new MetricRegistry();
      r0 = startConsoleReporter(registry);
      r1 = startInfluxdbReporter(registry);

      final Meter mymeter0 = registry.meter("MyMeter.0");
      for (int i = 0; i < 100; i++) {
        mymeter0.mark();
        mymeter0.mark(Math.round(Math.random() * 100.0));
        Thread.sleep(Math.round(Math.random() * 1000.0));
      }
    } catch (Exception exc) {
      exc.printStackTrace();
      System.exit(1);
    } finally {
      if (r1 != null) {
        r1.report();
        r1.stop();
      }
      if (r0 != null) {
        r0.report();
        r0.stop();
      }
View Full Code Here

TOP

Related Classes of com.codahale.metrics.ScheduledReporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.