Last active
August 29, 2015 14:16
-
-
Save chbatey/ed5ae8f51131abc75cb3 to your computer and use it in GitHub Desktop.
Metric and Graphite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
private Session session; | |
@Inject | |
private MetricRegistry metricRegistry; | |
@Bean | |
public MetricRegistry metricRegistry() { | |
return session.getCluster().getMetrics().getRegistry(); | |
} | |
@Bean | |
public GraphiteReporter graphiteReporter() { | |
LOGGER.debug("Creating graphite reporter"); | |
final Graphite graphite = new Graphite(new InetSocketAddress("192.168.10.120", 2003)); | |
final GraphiteReporter reporter = GraphiteReporter.forRegistry(metricRegistry) | |
.prefixedWith("KillrAuction") | |
.convertRatesTo(TimeUnit.SECONDS) | |
.convertDurationsTo(TimeUnit.MILLISECONDS) | |
.filter(MetricFilter.ALL) | |
.build(graphite); | |
reporter.start(30, TimeUnit.SECONDS); | |
return reporter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment