use of com.codahale.metrics.jvm.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet in project lucene-solr by apache.
the class SolrDispatchFilter method setupJvmMetrics.
private void setupJvmMetrics(CoreContainer coresInit) {
SolrMetricManager metricManager = coresInit.getMetricManager();
final Set<String> hiddenSysProps = coresInit.getConfig().getMetricsConfig().getHiddenSysProps();
try {
String registry = SolrMetricManager.getRegistryName(SolrInfoBean.Group.jvm);
metricManager.registerAll(registry, new AltBufferPoolMetricSet(), true, "buffers");
metricManager.registerAll(registry, new ClassLoadingGaugeSet(), true, "classes");
metricManager.registerAll(registry, new OperatingSystemMetricSet(), true, "os");
metricManager.registerAll(registry, new GarbageCollectorMetricSet(), true, "gc");
metricManager.registerAll(registry, new MemoryUsageGaugeSet(), true, "memory");
// todo should we use CachedThreadStatesGaugeSet instead?
metricManager.registerAll(registry, new ThreadStatesGaugeSet(), true, "threads");
MetricsMap sysprops = new MetricsMap((detailed, map) -> {
System.getProperties().forEach((k, v) -> {
if (!hiddenSysProps.contains(k)) {
map.put(String.valueOf(k), v);
}
});
});
metricManager.registerGauge(null, registry, sysprops, true, "properties", "system");
} catch (Exception e) {
log.warn("Error registering JVM metrics", e);
}
}
use of com.codahale.metrics.jvm.GarbageCollectorMetricSet 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.GarbageCollectorMetricSet in project bookkeeper by apache.
the class CodahaleMetricsProvider method initIfNecessary.
synchronized void initIfNecessary() {
if (metrics == null) {
metrics = new MetricRegistry();
metrics.registerAll(new MemoryUsageGaugeSet());
metrics.registerAll(new GarbageCollectorMetricSet());
}
}
use of com.codahale.metrics.jvm.GarbageCollectorMetricSet in project microservices by pwillhan.
the class MetricSystem method init.
@PostConstruct
public void init() {
// ConsoleReporter consoleReporter = ConsoleReporter.forRegistry(metricRegistry)
// .convertRatesTo(TimeUnit.SECONDS)
// .convertDurationsTo(TimeUnit.MILLISECONDS)
// .build();
//
// consoleReporter.start(10, TimeUnit.SECONDS);
// Graphite graphite = new Graphite(new InetSocketAddress("192.168.99.100", 2003));
// GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(metricRegistry)
// .prefixedWith("com.packt.microservices.geolocation")
// .convertRatesTo(TimeUnit.SECONDS)
// .convertDurationsTo(TimeUnit.MILLISECONDS)
// .filter(MetricFilter.ALL)
// .build(graphite);
// graphiteReporter.start(60, TimeUnit.SECONDS);
geolocationWriteRequestCount = metricRegistry.counter("geolocationWriteRequestCount");
metricRegistry.register("geolocationLastWriteTime", new Gauge<Long>() {
@Override
public Long getValue() {
return geolocationLastWriteTime;
}
});
metricRegistry.registerAll(new MetricSet() {
@Override
public Map<String, Metric> getMetrics() {
Map<String, Metric> metrics = new HashMap<>();
metrics.put("geolocationMemoryUsage", new MemoryUsageGaugeSet());
metrics.put("geolocationClassLoading", new ClassLoadingGaugeSet());
metrics.put("geolocationGarbageCollector", new GarbageCollectorMetricSet());
return metrics;
}
});
}
Aggregations