code: private void initReporter() {
      String reporterType =
        System.getProperty("net.spy.metrics.reporter.type", DEFAULT_REPORTER_TYPE);
      String reporterInterval =
        System.getProperty("net.spy.metrics.reporter.interval", DEFAULT_REPORTER_INTERVAL);
      String reporterDir =
        System.getProperty("net.spy.metrics.reporter.outdir", DEFAULT_REPORTER_OUTDIR);
  
      if(reporterType.equals("console")) {
        final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.SECONDS)
          .build();
        reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
      } else if (reporterType.equals("jmx")) {
        final JmxReporter reporter = JmxReporter.forRegistry(registry)
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.SECONDS)
          .build();
        reporter.start();
      } else if (reporterType.equals("csv")) {
        final CsvReporter reporter = CsvReporter.forRegistry(registry)
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.SECONDS)
          .build(new File(reporterDir));
        reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
      } else if (reporterType.equals("slf4j")) {
        final Slf4jReporter reporter = Slf4jReporter.forRegistry(registry)
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.SECONDS)
          .outputTo(LoggerFactory.getLogger(MetricCollector.class))
          .build();
        reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
      } else {
          throw new IllegalStateException("Unknown Metrics Reporter Type: " + reporterType);
      }
    }
docs: Initialize the proper metrics Reporter.