Search in sources :

Example 1 with JvmAttributeGaugeSet

use of com.codahale.metrics.jvm.JvmAttributeGaugeSet in project dropwizard by dropwizard.

the class Bootstrap method registerMetrics.

/**
 * Registers the JVM metrics to the metric registry and start to report
 * the registry metrics via JMX.
 */
public void registerMetrics() {
    if (metricsAreRegistered) {
        return;
    }
    getMetricRegistry().register("jvm.attribute", new JvmAttributeGaugeSet());
    getMetricRegistry().register("jvm.buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
    getMetricRegistry().register("jvm.classloader", new ClassLoadingGaugeSet());
    getMetricRegistry().register("jvm.filedescriptor", new FileDescriptorRatioGauge());
    getMetricRegistry().register("jvm.gc", new GarbageCollectorMetricSet());
    getMetricRegistry().register("jvm.memory", new MemoryUsageGaugeSet());
    getMetricRegistry().register("jvm.threads", new ThreadStatesGaugeSet());
    jmxReporter = JmxReporter.forRegistry(metricRegistry).build();
    jmxReporter.start();
    metricsAreRegistered = true;
}
Also used : BufferPoolMetricSet(com.codahale.metrics.jvm.BufferPoolMetricSet) JvmAttributeGaugeSet(com.codahale.metrics.jvm.JvmAttributeGaugeSet) FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) ClassLoadingGaugeSet(com.codahale.metrics.jvm.ClassLoadingGaugeSet) ThreadStatesGaugeSet(com.codahale.metrics.jvm.ThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet)

Aggregations

BufferPoolMetricSet (com.codahale.metrics.jvm.BufferPoolMetricSet)1 ClassLoadingGaugeSet (com.codahale.metrics.jvm.ClassLoadingGaugeSet)1 FileDescriptorRatioGauge (com.codahale.metrics.jvm.FileDescriptorRatioGauge)1 GarbageCollectorMetricSet (com.codahale.metrics.jvm.GarbageCollectorMetricSet)1 JvmAttributeGaugeSet (com.codahale.metrics.jvm.JvmAttributeGaugeSet)1 MemoryUsageGaugeSet (com.codahale.metrics.jvm.MemoryUsageGaugeSet)1 ThreadStatesGaugeSet (com.codahale.metrics.jvm.ThreadStatesGaugeSet)1