code: public static void createSlf4jReporter(DropwizardMetricRegistry registry, Logger logger,
        long period, TimeUnit unit) {
      MetricFilter nonZeroMatcher =
          new MetricFilter() {
            @Override
            public boolean matches(String name, Metric metric) {
              if (metric instanceof Counting) {
                Counting counter = (Counting) metric;
                return counter.getCount() > 0;
              }
              return true;
            }
          };
      Slf4jReporter.forRegistry(registry.getRegistry())
          .outputTo(logger)
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.MILLISECONDS)
          .filter(nonZeroMatcher)
          .build()
          .start(period, unit);
    }
docs: Creates a {@link DropwizardMetricRegistry} with an {@link Slf4jReporter}.  Only non-zero metrics
  will be logged to the {@link Slf4jReporter}.
  
  @param registry The registry on which to add the reporter.
  @param logger The {@link Logger} to report to
  @param period the amount of time between polls
  @param unit   the unit for {@code period}