コード例 #1
0
 @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;
 }
コード例 #2
0
 /**
  * Initializes the console reporter based on the current configuration.
  *
  * @param config the console reporter configuration
  */
 private void configureConsoleReporter(ConsoleReporterConfig config) {
   if (config.isEnabled()) {
     consoleReporter =
         ConsoleReporter.forRegistry(metricRegistry)
             .convertRatesTo(config.getConvertRates())
             .convertDurationsTo(config.getConvertDurations())
             .build();
     consoleReporter.start(config.getFrequency(), config.getFrequencyUnit());
   }
 }
コード例 #3
0
 @Before
 public void before_reporter() {
   reporter.start(1, TimeUnit.SECONDS);
 }