com.yammer.metrics.reporting.GraphiteReporter Java Examples

The following examples show how to use com.yammer.metrics.reporting.GraphiteReporter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReporterSetup.java    From incubator-retired-blur with Apache License 2.0 5 votes vote down vote up
public static void setupReporter(BlurConfiguration configuration, String reporter) {
  reporter = reporter.trim();
  try {
    TYPES type = TYPES.valueOf(reporter.trim());
    switch (type) {
    case ConsoleReporter:
      setupConsoleReporter(configuration);
      return;
    case CsvReporter:
      setupCsvReporter(configuration);
      return;
    case GangliaReporter:
      setupGangliaReporter(configuration);
      return;
    case GraphiteReporter:
      setupGraphiteReporter(configuration);
      return;
    default:
      break;
    }
  } catch (IllegalArgumentException e) {
    LOG.info("Cannot resolve reporter of type [{0}] trying to find class.", reporter);
    try {
      Class<?> reporterClazz = Class.forName(reporter);
      reflectiveSetup(reporterClazz, configuration, reporter);
    } catch (ClassNotFoundException ex) {
      LOG.error("Cannot find class [{0}]", reporter);
    }
  }
}
 
Example #2
Source File: ReporterSetup.java    From incubator-retired-blur with Apache License 2.0 5 votes vote down vote up
private static void setupGraphiteReporter(BlurConfiguration configuration) {
  long period = configuration.getLong(BLUR_SHARD_METRICS_REPORTER_PREFIX + "graphite." + "period", 5l);
  TimeUnit unit = TimeUnit.valueOf(configuration.get(BLUR_SHARD_METRICS_REPORTER_PREFIX + "graphite." + "unit",
      "SECONDS").toUpperCase());
  String host = configuration.get(BLUR_SHARD_METRICS_REPORTER_PREFIX + "graphite." + "host", "localhost");
  int port = configuration.getInt(BLUR_SHARD_METRICS_REPORTER_PREFIX + "graphite." + "port", -1);
  String prefix = configuration.get(BLUR_SHARD_METRICS_REPORTER_PREFIX + "graphite." + "prefix", "");
  GraphiteReporter.enable(period, unit, host, port, prefix);
}
 
Example #3
Source File: SimpleGraphiteStormMetricProcessor.java    From storm-metrics-reporter with Apache License 2.0 5 votes vote down vote up
public SimpleGraphiteStormMetricProcessor(final Map config) {
    super(config);

    try {
        graphiteReporter = new GraphiteReporter(StormMetricProcessor.METRICS_REGISTRY,
                getGraphiteServerHost(),
                getGraphiteServerPort(),
                Metric.joinNameFragments("Storm", topologyName));

        graphiteReporter.start(getGraphiteReportPeriod(), TimeUnit.SECONDS);
    } catch (final Exception e) {
        throw new RuntimeException(e);
    }
}