use of com.codahale.metrics.jvm.BufferPoolMetricSet in project mica2 by obiba.
the class MetricsConfiguration method init.
@PostConstruct
public void init() {
log.debug("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 = JmxReporter.forRegistry(METRIC_REGISTRY).build();
jmxReporter.start();
}
}
use of com.codahale.metrics.jvm.BufferPoolMetricSet in project curiostack by curioswitch.
the class MonitoringModule method configureJvmMetrics.
private static void configureJvmMetrics(MetricRegistry registry) {
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
registry.register("jvm.buffer-pool", new BufferPoolMetricSet(mBeanServer));
registry.register("jvm.class-loading", new ClassLoadingGaugeSet());
registry.register("jvm.file-descriptor-ratio", new FileDescriptorRatioGauge());
registry.register("jvm.gc", new GarbageCollectorMetricSet());
registry.register("jvm.memory", new MemoryUsageGaugeSet());
registry.register("jvm.threads", new ThreadStatesGaugeSet());
}
use of com.codahale.metrics.jvm.BufferPoolMetricSet 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();
}
}
use of com.codahale.metrics.jvm.BufferPoolMetricSet in project riposte by Nike-Inc.
the class CodahaleMetricsEngine method reportJvmMetrics.
/**
* Adds JVM MetricSets to this engine. By default JVM metrics are not placed in the Registry
*/
public CodahaleMetricsEngine reportJvmMetrics() {
// add JVM metrics
if (!jvmMetricsAdded) {
metricsCollector.registerAll("JVM-gc", new GarbageCollectorMetricSet());
metricsCollector.registerAll("JVM-buffers", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
metricsCollector.registerAll("JVM-memory", new MemoryUsageGaugeSet());
metricsCollector.registerAll("JVM-threads", new ThreadStatesGaugeSet());
jvmMetricsAdded = true;
}
return this;
}
use of com.codahale.metrics.jvm.BufferPoolMetricSet 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);
}
Aggregations