Package com.codahale.metrics.graphite

Examples of com.codahale.metrics.graphite.GraphiteReporter


            if (graphiteEnabled) {
                log.info("Initializing Metrics Graphite reporting");
                String graphiteHost = propertyResolver.getRequiredProperty(PROP_HOST);
                Integer graphitePort = propertyResolver.getRequiredProperty(PROP_PORT, Integer.class);
                Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, graphitePort));
                GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metricRegistry)
                        .convertRatesTo(TimeUnit.SECONDS)
                        .convertDurationsTo(TimeUnit.MILLISECONDS)
                        .build(graphite);
                graphiteReporter.start(1, TimeUnit.MINUTES);
            }
        }
View Full Code Here


        if (StringUtils.isNotBlank(metricPrefix)) {
            LOGGER.info("Metric prefix: {}", metricPrefix);
            builder.prefixedWith(metricPrefix);
        }

        final GraphiteReporter reporter = builder.build(graphite);
        reporter.start(pollTimeMinutes, TimeUnit.MINUTES);

        return new MetricReporter(metricRegistry, reporter, histogramBuilder);
    }
View Full Code Here

            if (graphiteEnabled) {
                log.info("Initializing Metrics Graphite reporting");
                String graphiteHost = propertyResolver.getRequiredProperty(PROP_HOST);
                Integer graphitePort = propertyResolver.getRequiredProperty(PROP_PORT, Integer.class);
                Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, graphitePort));
                GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metricRegistry)
                        .convertRatesTo(TimeUnit.SECONDS)
                        .convertDurationsTo(TimeUnit.MILLISECONDS)
                        .build(graphite);
                graphiteReporter.start(1, TimeUnit.MINUTES);
            }
        }
View Full Code Here

            try
            {
                logger.info(String.format("Enabling GraphiteReporter to %s:%s", hostPort.getHost(), hostPort.getPort()));

                final Graphite graphite = new Graphite(new InetSocketAddress(hostPort.getHost(), hostPort.getPort()));
                final GraphiteReporter reporter = GraphiteReporter.forRegistry(this.metricRegistry)
                        .convertDurationsTo(this.getRealDurationTimeUnitConversion())
                        .convertRatesTo(this.getRealRateTimeUnitConversion())
                        .prefixedWith(this.prefix)
                        .filter(new RegexMetricFilter(this.inclusion, this.exclusion))
                        .build(graphite);
                reporter.start(this.period, this.getRealTimeUnit());

                reporters.add(reporter);

            }
            catch (Exception e)
View Full Code Here

    private void setupGraphiteReporter() {
        if (graphiteSettings.getGraphiteHost().isPresent()) {
            InetSocketAddress address = new InetSocketAddress(
                    graphiteSettings.getGraphiteHost().get(), graphiteSettings.getGraphitePort().or(2003));
            logger.info("Initializing Metrics Graphite reporting to {}", address);
            GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metrics)
                    .convertRatesTo(TimeUnit.SECONDS)
                    .convertDurationsTo(TimeUnit.MILLISECONDS)
                    .build(new Graphite(address));
            graphiteReporter.start(graphiteSettings.getFrequency().get(),
                    TimeUnit.valueOf(graphiteSettings.getFrequencyUnit().get()));
        }
    }
View Full Code Here

TOP

Related Classes of com.codahale.metrics.graphite.GraphiteReporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.