Package com.codahale.metrics

Examples of com.codahale.metrics.ConsoleReporter.start()


    final ConsoleReporter reporter = ConsoleReporter
        .forRegistry(registry)
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.MILLISECONDS)
        .build();
    reporter.start(1, TimeUnit.MINUTES);
    return reporter;
  }
}
View Full Code Here


            File basedir = new File(System.getProperty("rhq.metrics.simulator.basedir"));
            File logDir = new File(basedir, "log");
            ConsoleReporter consoleReporter = ConsoleReporter.forRegistry(metrics.registry)
                .convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS)
                .outputTo(new PrintStream(new FileOutputStream(new File(logDir, "metrics.txt")))).build();
            consoleReporter.start(reportInterval, TimeUnit.SECONDS);
            return consoleReporter;
        } catch (FileNotFoundException e) {
            throw new RuntimeException("Failed to create console reporter", e);
        }
    }
View Full Code Here

  @Override
  public ConsoleReporter get() {
    ConsoleReporter reporter = ConsoleReporter.forRegistry(metricRegistry).build();
    String interval = launchConfig.getOther("metrics.scheduledreporter.interval", "30");
    reporter.start(Long.parseLong(interval), TimeUnit.SECONDS);
    return reporter;
  }
}
View Full Code Here

        final ConsoleReporter reporter = ConsoleReporter.forRegistry(cmm.getMetrics())
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.SECONDS)
                .outputTo(new PrintStream(baos))
                .build();
        reporter.start(1, TimeUnit.SECONDS);
        try {
            Thread.sleep(1800);
        } catch (InterruptedException e) {
        }
View Full Code Here

        final ConsoleReporter reporter = ConsoleReporter.forRegistry(cmm.getMetrics())
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.SECONDS)
                .outputTo(new PrintStream(baos))
                .build();
        reporter.start(1, TimeUnit.SECONDS);
        try {
            Thread.sleep(1800);
        } catch (InterruptedException e) {
        }
View Full Code Here

    Metrics.getMetrics().registerAll(Metrics.getJstack());
    final ConsoleReporter reporter = ConsoleReporter
        .forRegistry(Metrics.getMetrics())
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.MILLISECONDS).build();
    reporter.start(1, TimeUnit.MINUTES);

    thread.start();
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.