Package com.codahale.metrics.graphite

Examples of com.codahale.metrics.graphite.Graphite


            Boolean graphiteEnabled = propertyResolver.getProperty(PROP_GRAPHITE_ENABLED, Boolean.class, false);
            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 (!succcesfulConfigured) {
            throw new IllegalStateException("MetricReporterBuilder is not successfully configured.");
        }

        final MetricRegistry metricRegistry = new MetricRegistry();
        final Graphite graphite = new Graphite(new InetSocketAddress(graphiteHost, graphitePort));

        final Builder builder =
            GraphiteReporter.forRegistry(metricRegistry).convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS).filter(MetricFilter.ALL);
        if (StringUtils.isNotBlank(metricPrefix)) {
View Full Code Here

            Boolean graphiteEnabled = propertyResolver.getProperty(PROP_GRAPHITE_ENABLED, Boolean.class, false);
            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

        this.prefix = prefix;
    }

    @Override
    public ScheduledReporter build(MetricRegistry registry) {
        final Graphite graphite = new Graphite(new InetSocketAddress(host, port));
        return GraphiteReporter.forRegistry(registry)
                               .convertDurationsTo(getDurationUnit())
                               .convertRatesTo(getRateUnit())
                               .filter(getFilter())
                               .prefixedWith(getPrefix())
View Full Code Here

      GraphiteReporter.forRegistry(getMetricRegistry())
          .prefixedWith(getGraphitePrefix(measurementSession))
          .convertRatesTo(TimeUnit.SECONDS)
          .convertDurationsTo(TimeUnit.MILLISECONDS)
          .filter(filter)
          .build(new Graphite(new InetSocketAddress(graphiteHostName, corePlugin.getGraphitePort())))
          .start(reportingInterval, TimeUnit.SECONDS);
    }
  }
View Full Code Here

    else {
      final String hostname = getProperty(HOST);
      final int port = getProperty(PORT, Integer.TYPE);

      if ("tcp".equals(transport)) {
        graphite = new Graphite(hostname, port, SocketFactory.getDefault(), charset);
      }
      else if ("udp".equals(transport)) {
        graphite = new GraphiteUDP(hostname, port);
      }
      else if ("pickle".equals(transport)) {
View Full Code Here

            final GraphiteSender sender;
            if (isPickled) {
                sender = new PickledGraphite(graphiteAddress);
            } else {
                sender = new Graphite(graphiteAddress);
            }

            reporter = GraphiteReporter
                    .forRegistry(metricsService.getMetricRegistry())
                    .prefixedWith(hostname).convertRatesTo(TimeUnit.SECONDS)
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))
View Full Code Here

                    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.Graphite

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.