Package com.codahale.metrics

Examples of com.codahale.metrics.JmxReporter


        // This is holding all our metrics.
        final MetricRegistry metrics = injector.getInstance(MetricRegistry.class);

        // Report metrics via JMX.
        final JmxReporter reporter = JmxReporter.forRegistry(metrics).build();
        reporter.start();

        InstrumentedAppender logMetrics = new InstrumentedAppender(metrics);
        logMetrics.activateOptions();
        org.apache.log4j.Logger.getRootLogger().setLevel(logLevel);
        org.apache.log4j.Logger.getLogger(Main.class.getPackage().getName()).setLevel(logLevel);
View Full Code Here


        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet());
        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge());
        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
        if (propertyResolver.getProperty(PROP_JMX_ENABLED, Boolean.class, false)) {
            log.info("Initializing Metrics JMX reporting");
            final JmxReporter jmxReporter = JmxReporter.forRegistry(METRIC_REGISTRY).build();
            jmxReporter.start();
        }
    }
View Full Code Here

        // This is holding all our metrics.
        final MetricRegistry metrics = injector.getInstance(MetricRegistry.class);

        // Report metrics via JMX.
        final JmxReporter reporter = JmxReporter.forRegistry(metrics).build();
        reporter.start();

        InstrumentedAppender logMetrics = new InstrumentedAppender(metrics);
        logMetrics.activateOptions();
        org.apache.log4j.Logger.getRootLogger().addAppender(logMetrics);
View Full Code Here

      REGISTRY.registerAll(new ThreadStatesGaugeSet());
    }

    private static JmxReporter getJmxReporter() {
      if (config.getBoolean(ExecConstants.METRICS_JMX_OUTPUT_ENABLED)) {
        JmxReporter reporter = JmxReporter.forRegistry(getInstance()).build();
        reporter.start();

        return reporter;
      } else
        return null;
    }
View Full Code Here

        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_THREADS, new ThreadStatesGaugeSet());
        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_FILES, new FileDescriptorRatioGauge());
        METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
        if (propertyResolver.getProperty(PROP_JMX_ENABLED, Boolean.class, false)) {
            log.info("Initializing Metrics JMX reporting");
            final JmxReporter jmxReporter = JmxReporter.forRegistry(METRIC_REGISTRY).build();
            jmxReporter.start();
        }
    }
View Full Code Here

  private String name(String... names) {
    return MetricRegistry.name(SingularityS3DownloaderMetrics.class, names);
  }

  private void startJmxReporter() {
    JmxReporter reporter = JmxReporter.forRegistry(registry).build();
    reporter.start();
  }
View Full Code Here

  private String name(String... names) {
    return MetricRegistry.name(SingularityOOMKillerMetrics.class, names);
  }

  private void startJmxReporter() {
    JmxReporter reporter = JmxReporter.forRegistry(registry).build();
    reporter.start();
  }
View Full Code Here

  public void error() {
    errorCounter.inc();
  }

  private void startJmxReporter() {
    JmxReporter reporter = JmxReporter.forRegistry(registry).build();
    reporter.start();
  }
View Full Code Here

        Map<String, JmxReporter> reporters = REGISTRIES.get(registry);
        if (reporters == null) {
          reporters = Maps.newHashMap();
          REGISTRIES.put(registry, reporters);
        }
        JmxReporter reporter = reporters.get(domain);
        if (reporter == null) {
          Builder reporterBuilder = JmxReporter.forRegistry(registry)
              .filter(filter)
              .convertDurationsTo(defaultDurationUnit)
              .convertRatesTo(defaultRateUnit)
              .specificDurationUnits(durationUnits)
              .specificRateUnits(rateUnits)
              .inDomain(domain);
         
          reporter = reporterBuilder.build();
          reporter.start();
          reporters.put(domain, reporter);
        }
      }
    }
View Full Code Here

      for (Object event : Notifications.getLifecycleEvents(notification)) {
        if (event == Notifications.LifecycleEvent.SHUTDOWN) {
          synchronized (REGISTRIES) {
            Map<String, JmxReporter> reporters = REGISTRIES.get(getContext().getMetricRegistry());
            if (reporters != null) {
              JmxReporter reporter = reporters.remove(domain);
              if (reporter != null) {
                reporter.stop();
              }
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.codahale.metrics.JmxReporter

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.