Search in sources :

Example 1 with IndyMetricsConfig

use of org.commonjava.indy.metrics.conf.IndyMetricsConfig 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);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ZabbixCacheStorage(org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage) IndyMetricsConfig(org.commonjava.indy.metrics.conf.IndyMetricsConfig) IndyZabbixSender(org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender) Graphite(com.codahale.metrics.graphite.Graphite) InetSocketAddress(java.net.InetSocketAddress) IndyHttpProvider(org.commonjava.indy.subsys.http.IndyHttpProvider) Inject(javax.inject.Inject) TimeUnit(java.util.concurrent.TimeUnit) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter) IndyMetricsNamed(org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) ConsoleReporter(com.codahale.metrics.ConsoleReporter) ApplicationScoped(javax.enterprise.context.ApplicationScoped) InetSocketAddress(java.net.InetSocketAddress) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) Graphite(com.codahale.metrics.graphite.Graphite)

Example 2 with IndyMetricsConfig

use of org.commonjava.indy.metrics.conf.IndyMetricsConfig in project indy by Commonjava.

the class ReporterIntializer method initZabbixReporterForHealthCheckMetric.

private void initZabbixReporterForHealthCheckMetric(MetricRegistry metrics, IndyMetricsConfig config) {
    IndyZabbixReporter reporter = initZabbixReporter(metrics, config).filter((name, metric) -> {
        if (!name.contains(FILTER_SIMPLE) && name.contains(FILTER_HEALTHCHECK)) {
            return true;
        }
        return false;
    }).build(initZabbixSender());
    reporter.start(config.getZabbixHealthcheckPeriod(), TimeUnit.SECONDS);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ZabbixCacheStorage(org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage) IndyMetricsConfig(org.commonjava.indy.metrics.conf.IndyMetricsConfig) IndyZabbixSender(org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender) Graphite(com.codahale.metrics.graphite.Graphite) InetSocketAddress(java.net.InetSocketAddress) IndyHttpProvider(org.commonjava.indy.subsys.http.IndyHttpProvider) Inject(javax.inject.Inject) TimeUnit(java.util.concurrent.TimeUnit) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter) IndyMetricsNamed(org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) ConsoleReporter(com.codahale.metrics.ConsoleReporter) ApplicationScoped(javax.enterprise.context.ApplicationScoped) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter)

Example 3 with IndyMetricsConfig

use of org.commonjava.indy.metrics.conf.IndyMetricsConfig 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);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ZabbixCacheStorage(org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage) IndyMetricsConfig(org.commonjava.indy.metrics.conf.IndyMetricsConfig) IndyZabbixSender(org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender) Graphite(com.codahale.metrics.graphite.Graphite) InetSocketAddress(java.net.InetSocketAddress) IndyHttpProvider(org.commonjava.indy.subsys.http.IndyHttpProvider) Inject(javax.inject.Inject) TimeUnit(java.util.concurrent.TimeUnit) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter) IndyMetricsNamed(org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) ConsoleReporter(com.codahale.metrics.ConsoleReporter) ApplicationScoped(javax.enterprise.context.ApplicationScoped) InetSocketAddress(java.net.InetSocketAddress) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) Graphite(com.codahale.metrics.graphite.Graphite)

Example 4 with IndyMetricsConfig

use of org.commonjava.indy.metrics.conf.IndyMetricsConfig in project indy by Commonjava.

the class ReporterIntializer method initZabbixReporterForSimpleMetric.

private void initZabbixReporterForSimpleMetric(MetricRegistry metrics, IndyMetricsConfig config) {
    IndyZabbixReporter reporter = initZabbixReporter(metrics, config).filter((name, metric) -> {
        if (name.contains(FILTER_SIMPLE)) {
            return true;
        }
        return false;
    }).build(initZabbixSender());
    reporter.start(config.getZabbixSimplePriod(), TimeUnit.SECONDS);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ZabbixCacheStorage(org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage) IndyMetricsConfig(org.commonjava.indy.metrics.conf.IndyMetricsConfig) IndyZabbixSender(org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender) Graphite(com.codahale.metrics.graphite.Graphite) InetSocketAddress(java.net.InetSocketAddress) IndyHttpProvider(org.commonjava.indy.subsys.http.IndyHttpProvider) Inject(javax.inject.Inject) TimeUnit(java.util.concurrent.TimeUnit) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter) IndyMetricsNamed(org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) ConsoleReporter(com.codahale.metrics.ConsoleReporter) ApplicationScoped(javax.enterprise.context.ApplicationScoped) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter)

Example 5 with IndyMetricsConfig

use of org.commonjava.indy.metrics.conf.IndyMetricsConfig 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);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) ZabbixCacheStorage(org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage) IndyMetricsConfig(org.commonjava.indy.metrics.conf.IndyMetricsConfig) IndyZabbixSender(org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender) Graphite(com.codahale.metrics.graphite.Graphite) InetSocketAddress(java.net.InetSocketAddress) IndyHttpProvider(org.commonjava.indy.subsys.http.IndyHttpProvider) Inject(javax.inject.Inject) TimeUnit(java.util.concurrent.TimeUnit) IndyZabbixReporter(org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter) IndyMetricsNamed(org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) ConsoleReporter(com.codahale.metrics.ConsoleReporter) ApplicationScoped(javax.enterprise.context.ApplicationScoped) InetSocketAddress(java.net.InetSocketAddress) GraphiteReporter(com.codahale.metrics.graphite.GraphiteReporter) Graphite(com.codahale.metrics.graphite.Graphite)

Aggregations

ConsoleReporter (com.codahale.metrics.ConsoleReporter)6 MetricRegistry (com.codahale.metrics.MetricRegistry)6 Graphite (com.codahale.metrics.graphite.Graphite)6 GraphiteReporter (com.codahale.metrics.graphite.GraphiteReporter)6 InetSocketAddress (java.net.InetSocketAddress)6 TimeUnit (java.util.concurrent.TimeUnit)6 ApplicationScoped (javax.enterprise.context.ApplicationScoped)6 Inject (javax.inject.Inject)6 IndyMetricsConfig (org.commonjava.indy.metrics.conf.IndyMetricsConfig)6 IndyMetricsNamed (org.commonjava.indy.metrics.conf.annotation.IndyMetricsNamed)6 ZabbixCacheStorage (org.commonjava.indy.metrics.zabbix.cache.ZabbixCacheStorage)6 IndyZabbixReporter (org.commonjava.indy.metrics.zabbix.reporter.IndyZabbixReporter)6 IndyZabbixSender (org.commonjava.indy.metrics.zabbix.sender.IndyZabbixSender)6 IndyHttpProvider (org.commonjava.indy.subsys.http.IndyHttpProvider)6