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;
}
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;
}
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);
}
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());
}
}
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();
}
}
Aggregations