Search in sources :

Example 1 with CachedThreadStatesGaugeSet

use of com.codahale.metrics.jvm.CachedThreadStatesGaugeSet in project infrautils by opendaylight.

the class MetricProviderImpl method setUpJvmMetrics.

private static void setUpJvmMetrics(MetricRegistry registry) {
    ThreadDeadlockDetector threadDeadlockDetector = new ThreadDeadlockDetector();
    FileDescriptorRatioGauge fileDescriptorRatioGauge = new FileDescriptorRatioGauge();
    registry.registerAll(new GarbageCollectorMetricSet());
    registry.registerAll(new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
    registry.registerAll(new CachedThreadStatesGaugeSet(getThreadMXBean(), threadDeadlockDetector, 13, SECONDS));
    registry.registerAll(new MemoryUsageGaugeSet());
    registry.registerAll(new ClassLoadingGaugeSet());
    registry.gauge("odl.infrautils.FileDescriptorRatio", () -> fileDescriptorRatioGauge);
}
Also used : BufferPoolMetricSet(com.codahale.metrics.jvm.BufferPoolMetricSet) FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) ThreadDeadlockDetector(com.codahale.metrics.jvm.ThreadDeadlockDetector) ClassLoadingGaugeSet(com.codahale.metrics.jvm.ClassLoadingGaugeSet) CachedThreadStatesGaugeSet(com.codahale.metrics.jvm.CachedThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet)

Example 2 with CachedThreadStatesGaugeSet

use of com.codahale.metrics.jvm.CachedThreadStatesGaugeSet in project knox by apache.

the class DefaultMetricsService method registerJvmMetricSets.

private void registerJvmMetricSets() {
    metrics.registerAll(new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
    metrics.registerAll(new CachedThreadStatesGaugeSet(5, TimeUnit.MINUTES));
    metrics.registerAll(new ClassLoadingGaugeSet());
    metrics.registerAll(new GarbageCollectorMetricSet());
    metrics.registerAll(new JvmAttributeGaugeSet());
    metrics.registerAll(new MemoryUsageGaugeSet());
}
Also used : BufferPoolMetricSet(com.codahale.metrics.jvm.BufferPoolMetricSet) JvmAttributeGaugeSet(com.codahale.metrics.jvm.JvmAttributeGaugeSet) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) ClassLoadingGaugeSet(com.codahale.metrics.jvm.ClassLoadingGaugeSet) CachedThreadStatesGaugeSet(com.codahale.metrics.jvm.CachedThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet)

Aggregations

BufferPoolMetricSet (com.codahale.metrics.jvm.BufferPoolMetricSet)2 CachedThreadStatesGaugeSet (com.codahale.metrics.jvm.CachedThreadStatesGaugeSet)2 ClassLoadingGaugeSet (com.codahale.metrics.jvm.ClassLoadingGaugeSet)2 GarbageCollectorMetricSet (com.codahale.metrics.jvm.GarbageCollectorMetricSet)2 MemoryUsageGaugeSet (com.codahale.metrics.jvm.MemoryUsageGaugeSet)2 FileDescriptorRatioGauge (com.codahale.metrics.jvm.FileDescriptorRatioGauge)1 JvmAttributeGaugeSet (com.codahale.metrics.jvm.JvmAttributeGaugeSet)1 ThreadDeadlockDetector (com.codahale.metrics.jvm.ThreadDeadlockDetector)1