Skip to content

Commit

Permalink
readd ReporterFactory, so we can write lazier spring configs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jun 11, 2013
1 parent 88cd8e5 commit 6f006fd
Showing 1 changed file with 40 additions and 0 deletions.
@@ -0,0 +1,40 @@
/**
* The contents of this file are subject to the license and copyright terms
* detailed in the license directory at the root of the source tree (also
* available online at http://fedora-commons.org/license/).
*/

package org.fcrepo.metrics;

import static com.codahale.metrics.graphite.GraphiteReporter.forRegistry;
import static java.util.concurrent.TimeUnit.MINUTES;
import static org.fcrepo.metrics.RegistryService.getMetrics;

import com.codahale.metrics.ScheduledReporter;
import com.codahale.metrics.graphite.Graphite;
import com.codahale.metrics.graphite.GraphiteReporter;

/**
* @todo Add Documentation.
* @author cbeer
* @date Mar 22, 2013
*/
public class ReporterFactory {

/**
* @todo Add Documentation.
*/
public ScheduledReporter registerGraphiteReporter(final Graphite g,
final String prefix) {
final GraphiteReporter r = forRegistry(getMetrics()).build(g);
r.start(1, MINUTES);
return r;
}

/**
* @todo Add Documentation.
*/
public static ReporterFactory buildDefaultReporterFactory() {
return new ReporterFactory();
}
}

0 comments on commit 6f006fd

Please sign in to comment.