use of com.codahale.metrics.Slf4jReporter.Builder in project Dempsy by Dempsy.
the class LogRegistrar method registerReporter.
@Override
public Reporter registerReporter(final MetricRegistry registry, final String metricPrefix) {
final Builder builder = Slf4jReporter.forRegistry(registry).shutdownExecutorOnStop(true).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).withLoggingLevel(loggingLevel);
if (prefix != null)
builder.prefixedWith(prefix);
final Slf4jReporter reporter = builder.build();
reporter.start(period, unit);
return reporter;
}
Aggregations