Examples of GraphiteReporter


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

Examples of com.codahale.metrics.graphite.GraphiteReporter

        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

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

Examples of com.codahale.metrics.graphite.GraphiteReporter

            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

Examples of com.codahale.metrics.graphite.GraphiteReporter

    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

Examples of com.yammer.metrics.reporting.GraphiteReporter

        String graphiteHost = properties.getProperty("metriccatcher.graphite.host");
        String graphitePort = properties.getProperty("metriccatcher.graphite.port");
        if (graphiteHost != null && graphitePort != null) {
            String hostname = InetAddress.getLocalHost().getHostName();
            logger.info("Creating Graphite reporter pointed at " + graphiteHost + ":" + graphitePort + " with prefix " + hostname);
            GraphiteReporter graphiteReporter = new GraphiteReporter(graphiteHost, Integer.parseInt(graphitePort), hostname);
            graphiteReporter.start(60, TimeUnit.SECONDS);
        }

        int maxMetrics = Integer.parseInt(properties.getProperty("metriccatcher.maxMetrics", "500"));
        logger.info("Max metrics: " + maxMetrics);
        Map<String, Metric> lruMap = new LRUMap<String, Metric>(10, maxMetrics);
View Full Code Here

Examples of com.yammer.metrics.reporting.GraphiteReporter

            String graphitePrefix = properties.getProperty(METRICCATCHER_GRAPHITE_PREFIX);
            if (graphitePrefix == null) {
                graphitePrefix = InetAddress.getLocalHost().getHostName();
            }
            logger.info("Creating Graphite reporter pointed at " + graphiteHost + ":" + graphitePort + " with prefix '" + graphitePrefix + "'");
            GraphiteReporter graphiteReporter = new GraphiteReporter(graphiteHost,
                                                                     Integer.parseInt(graphitePort),
                                                                     StringUtils.trimToNull(graphitePrefix));
            graphiteReporter.printVMMetrics = !disableJvmMetrics;
            graphiteReporter.start(reportingInterval, TimeUnit.SECONDS);
            reportingEnabled = true;
        }

        String reporterConfigFile = properties.getProperty(METRICCATCHER_REPORTER_CONFIG);
        if (reporterConfigFile != null) {
View Full Code Here

Examples of com.yammer.metrics.reporting.GraphiteReporter

    @Override
    public void init(VerifiableProperties props) {
        if (!initialized && !config.getStringProperty(CoreConfig.GRAPHITE_HOST).equals("")) {
            try {
                reporter = new GraphiteReporter(
                        Metrics.defaultRegistry(),
                        config.getStringProperty(CoreConfig.GRAPHITE_HOST),
                        config.getIntegerProperty(CoreConfig.GRAPHITE_PORT),
                        config.getStringProperty(CoreConfig.GRAPHITE_PREFIX + "kafka.")
                );
View Full Code Here

Examples of com.yammer.metrics.reporting.GraphiteReporter

            String graphitePrefix = properties.getProperty(METRICCATCHER_GRAPHITE_PREFIX);
            if (graphitePrefix == null) {
                graphitePrefix = InetAddress.getLocalHost().getHostName();
            }
            logger.info("Creating Graphite reporter pointed at " + graphiteHost + ":" + graphitePort + " with prefix '" + graphitePrefix + "'");
            GraphiteReporter graphiteReporter = new GraphiteReporter(graphiteHost, Integer.parseInt(graphitePort), StringUtils.trimToNull(graphitePrefix));
            graphiteReporter.printVMMetrics = !disableJvmMetrics;
            graphiteReporter.start(reportingInterval, TimeUnit.SECONDS);
            reportingEnabled = true;
        }

        String reporterConfigFile = properties.getProperty(METRICCATCHER_REPORTER_CONFIG);
        if (reporterConfigFile != null) {
View Full Code Here

Examples of com.yammer.metrics.reporting.GraphiteReporter

        String graphiteHost = properties.getProperty(METRICCATCHER_GRAPHITE_HOST);
        String graphitePort = properties.getProperty(METRICCATCHER_GRAPHITE_PORT);
        if (graphiteHost != null && graphitePort != null) {
            String hostname = InetAddress.getLocalHost().getHostName();
            logger.info("Creating Graphite reporter pointed at " + graphiteHost + ":" + graphitePort + " with prefix " + hostname);
            GraphiteReporter graphiteReporter = new GraphiteReporter(graphiteHost, Integer.parseInt(graphitePort), hostname);
            graphiteReporter.start(reportingInterval, TimeUnit.SECONDS);
        }

        int maxMetrics = Integer.parseInt(properties.getProperty(METRICCATCHER_MAX_METRICS, "500"));
        logger.info("Max metrics: " + maxMetrics);
        Map<String, Metric> lruMap = new LRUMap<String, Metric>(10, maxMetrics);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.