Search in sources :

Example 11 with FileDescriptorRatioGauge

use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project chassis by Kixeye.

the class MetricsConfiguration method metricRegistry.

/**
 * Initializes the metrics registry
 *
 * @return metric registry bean
 */
@Bean
public MetricRegistry metricRegistry() {
    final MetricRegistry bean = new MetricRegistry();
    // add JVM metrics
    bean.register("jvm.gc", new GarbageCollectorMetricSet());
    bean.register("jvm.memory", new MemoryUsageGaugeSet());
    bean.register("jvm.thread-states", new ThreadStatesGaugeSet());
    bean.register("jvm.fd", new FileDescriptorRatioGauge());
    return bean;
}
Also used : FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) MetricRegistry(com.codahale.metrics.MetricRegistry) ThreadStatesGaugeSet(com.codahale.metrics.jvm.ThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet) Bean(org.springframework.context.annotation.Bean)

Example 12 with FileDescriptorRatioGauge

use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project cas by apereo.

the class CasMetricsConfiguration method metrics.

/**
 * Metric registry metric registry.
 *
 * @return the metric registry
 */
@RefreshScope
@Bean
public MetricRegistry metrics() {
    final MetricRegistry metrics = new MetricRegistry();
    metrics.register("jvm.gc", new GarbageCollectorMetricSet());
    metrics.register("jvm.memory", new MemoryUsageGaugeSet());
    metrics.register("thread-states", new ThreadStatesGaugeSet());
    metrics.register("jvm.fd.usage", new FileDescriptorRatioGauge());
    return metrics;
}
Also used : FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) MetricRegistry(com.codahale.metrics.MetricRegistry) ThreadStatesGaugeSet(com.codahale.metrics.jvm.ThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 13 with FileDescriptorRatioGauge

use of com.codahale.metrics.jvm.FileDescriptorRatioGauge 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 14 with FileDescriptorRatioGauge

use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project incubator-gobblin by apache.

the class JMXReportingService method registerJvmMetrics.

private void registerJvmMetrics() {
    registerMetricSetWithPrefix("jvm.gc", new GarbageCollectorMetricSet());
    registerMetricSetWithPrefix("jvm.memory", new MemoryUsageGaugeSet());
    registerMetricSetWithPrefix("jvm.threads", new ThreadStatesGaugeSet());
    this.metricRegistry.register("jvm.fileDescriptorRatio", new FileDescriptorRatioGauge());
    for (Map.Entry<String, MetricSet> metricSet : this.additionalMetricSets.entrySet()) {
        registerMetricSetWithPrefix(metricSet.getKey(), metricSet.getValue());
    }
}
Also used : FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) ThreadStatesGaugeSet(com.codahale.metrics.jvm.ThreadStatesGaugeSet) ImmutableMap(com.google.common.collect.ImmutableMap) Map(java.util.Map) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet) MetricSet(com.codahale.metrics.MetricSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet)

Example 15 with FileDescriptorRatioGauge

use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project alien4cloud by alien4cloud.

the class MetricsConfiguration method init.

@PostConstruct
public void init() {
    log.info("Registering JVM gauges");
    METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_MEMORY, new MemoryUsageGaugeSet());
    METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_GARBAGE, new GarbageCollectorMetricSet());
    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");
        jmxReporter = JmxReporter.forRegistry(METRIC_REGISTRY).build();
        jmxReporter.start();
    }
}
Also used : BufferPoolMetricSet(com.codahale.metrics.jvm.BufferPoolMetricSet) FileDescriptorRatioGauge(com.codahale.metrics.jvm.FileDescriptorRatioGauge) MemoryUsageGaugeSet(com.codahale.metrics.jvm.MemoryUsageGaugeSet) ThreadStatesGaugeSet(com.codahale.metrics.jvm.ThreadStatesGaugeSet) GarbageCollectorMetricSet(com.codahale.metrics.jvm.GarbageCollectorMetricSet) PostConstruct(javax.annotation.PostConstruct)

Aggregations

FileDescriptorRatioGauge (com.codahale.metrics.jvm.FileDescriptorRatioGauge)18 GarbageCollectorMetricSet (com.codahale.metrics.jvm.GarbageCollectorMetricSet)17 MemoryUsageGaugeSet (com.codahale.metrics.jvm.MemoryUsageGaugeSet)17 ThreadStatesGaugeSet (com.codahale.metrics.jvm.ThreadStatesGaugeSet)14 BufferPoolMetricSet (com.codahale.metrics.jvm.BufferPoolMetricSet)8 MetricRegistry (com.codahale.metrics.MetricRegistry)7 ClassLoadingGaugeSet (com.codahale.metrics.jvm.ClassLoadingGaugeSet)5 JvmAttributeGaugeSet (com.codahale.metrics.jvm.JvmAttributeGaugeSet)3 Bean (org.springframework.context.annotation.Bean)3 Logger (ch.qos.logback.classic.Logger)2 LoggerContext (ch.qos.logback.classic.LoggerContext)2 MetricSet (com.codahale.metrics.MetricSet)2 InstrumentedAppender (com.codahale.metrics.logback.InstrumentedAppender)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 Map (java.util.Map)2 PostConstruct (javax.annotation.PostConstruct)2 JmxReporter (com.codahale.metrics.JmxReporter)1 CachedThreadStatesGaugeSet (com.codahale.metrics.jvm.CachedThreadStatesGaugeSet)1 ThreadDeadlockDetector (com.codahale.metrics.jvm.ThreadDeadlockDetector)1 InstrumentedFilter (com.codahale.metrics.servlet.InstrumentedFilter)1