use of com.codahale.metrics.jvm.ThreadStatesGaugeSet in project pinpoint by naver.
the class CollectorMetric method initRegistry.
private void initRegistry() {
// add JVM statistics
metricRegistry.register("jvm.memory", new MemoryUsageGaugeSet());
metricRegistry.register("jvm.vm", new JvmAttributeGaugeSet());
metricRegistry.register("jvm.garbage-collectors", new GarbageCollectorMetricSet());
metricRegistry.register("jvm.thread-states", new ThreadStatesGaugeSet());
if (hBaseAsyncOperationMetrics != null) {
Map<String, Metric> metrics = hBaseAsyncOperationMetrics.getMetrics();
for (Map.Entry<String, Metric> metric : metrics.entrySet()) {
metricRegistry.register(metric.getKey(), metric.getValue());
}
}
}
use of com.codahale.metrics.jvm.ThreadStatesGaugeSet 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.ThreadStatesGaugeSet 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.ThreadStatesGaugeSet 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;
}
Aggregations