use of com.codahale.metrics.jvm.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet in project incubator-ratis by apache.
the class JVMMetrics method addJvmMetrics.
static void addJvmMetrics(MetricRegistries registries) {
MetricRegistryInfo info = new MetricRegistryInfo("jvm", "ratis_jvm", "jvm", "jvm metrics");
RatisMetricRegistry registry = registries.create(info);
registry.registerAll("gc", new GarbageCollectorMetricSet());
registry.registerAll("memory", new MemoryUsageGaugeSet());
registry.registerAll("threads", new ThreadStatesGaugeSet());
registry.registerAll("classLoading", new ClassLoadingGaugeSet());
}
Aggregations