use of com.codahale.metrics.graphite.GraphiteReporter in project indy by Commonjava.
the class ReporterIntializer method initGraphiteReporterForHealthCheckMetric.
private void initGraphiteReporterForHealthCheckMetric(MetricRegistry metrics, IndyMetricsConfig config) {
final Graphite graphite = new Graphite(new InetSocketAddress(config.getGrphiterHostName(), config.getGrphiterPort()));
final GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics).prefixedWith(config.getGrphiterPrefix()).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).filter((name, metric) -> {
if (!name.contains(FILTER_SIMPLE) && name.contains(FILTER_HEALTHCHECK)) {
return true;
}
return false;
}).build(graphite);
reporter.start(config.getGrphiterHealthcheckPeriod(), TimeUnit.SECONDS);
}
use of com.codahale.metrics.graphite.GraphiteReporter in project indy by Commonjava.
the class ReporterIntializer method initGraphiteReporterForSimpleMetric.
private void initGraphiteReporterForSimpleMetric(MetricRegistry metrics, IndyMetricsConfig config) {
final Graphite graphite = new Graphite(new InetSocketAddress(config.getGrphiterHostName(), config.getGrphiterPort()));
final GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics).prefixedWith(config.getGrphiterPrefix()).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).filter((name, metric) -> {
if (name.contains(FILTER_SIMPLE)) {
return true;
}
return false;
}).build(graphite);
reporter.start(config.getGrphiterSimplePriod(), TimeUnit.SECONDS);
}
use of com.codahale.metrics.graphite.GraphiteReporter in project camel by apache.
the class Application method graphiteReporter.
/**
* Create reporter bean and tell Spring to call stop() when shutting down.
* UPD must be enabled in carbon.conf
*
* @return graphite reporter
*/
@Bean(destroyMethod = "stop")
public GraphiteReporter graphiteReporter() {
final GraphiteSender graphite = new GraphiteUDP(new InetSocketAddress("localhost", 2003));
final GraphiteReporter reporter = GraphiteReporter.forRegistry(metricRegistry).prefixedWith("camel-spring-boot").convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL).build(graphite);
reporter.start(5, TimeUnit.SECONDS);
return reporter;
}
use of com.codahale.metrics.graphite.GraphiteReporter in project indy by Commonjava.
the class ReporterIntializer method initGraphiteReporterForJVMMetric.
private void initGraphiteReporterForJVMMetric(MetricRegistry metrics, IndyMetricsConfig config) {
final Graphite graphite = new Graphite(new InetSocketAddress(config.getGrphiterHostName(), config.getGrphiterPort()));
final GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics).prefixedWith(config.getGrphiterPrefix()).convertRatesTo(TimeUnit.SECONDS).convertDurationsTo(TimeUnit.MILLISECONDS).filter((name, metric) -> {
if (!name.contains(FILTER_SIMPLE) && name.contains(FILTER_JVM)) {
return true;
}
return false;
}).build(graphite);
reporter.start(config.getGrphiterJVMPriod(), TimeUnit.SECONDS);
}
Aggregations