Search in sources :

Example 1 with Builder

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;
}
Also used : Builder(com.codahale.metrics.Slf4jReporter.Builder) Slf4jReporter(com.codahale.metrics.Slf4jReporter)

Aggregations

Slf4jReporter (com.codahale.metrics.Slf4jReporter)1 Builder (com.codahale.metrics.Slf4jReporter.Builder)1