use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project stdlib by petergeneric.
the class CoreMetricsModule method buildRegistry.
public static MetricRegistry buildRegistry() {
MetricRegistry registry = new MetricRegistry();
registry.register(MetricRegistry.name("jvm", "gc"), new GarbageCollectorMetricSet());
registry.register(MetricRegistry.name("jvm", "memory"), new MemoryUsageGaugeSet());
registry.register(MetricRegistry.name("jvm", "thread-states"), new ThreadStatesGaugeSet());
registry.register(MetricRegistry.name("jvm", "fd", "usage"), new FileDescriptorRatioGauge());
return registry;
}
use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project be5 by DevelopmentOnTheEdge.
the class MetricsModule method configureServlets.
@Override
protected void configureServlets() {
bind(AdminServlet.class).asEagerSingleton();
serve("/api/metrics/admin*").with(AdminServlet.class);
bind(MetricsServlet.class).asEagerSingleton();
serve("/metrics*").with(MetricsServlet.class);
bind(MetricsUIServlet.class).asEagerSingleton();
serve("/api/metrics/ui*").with(MetricsUIServlet.class);
filter("/*").through(new InstrumentedFilter());
Metrics.HEALTH_CHECKS.register("db", new DatabaseHealthCheck());
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_ATTRIBUTE, new JvmAttributeGaugeSet());
METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_CLASSLOADER, new ClassLoadingGaugeSet());
METRIC_REGISTRY.register(PROP_METRIC_REG_JVM_BUFFERS, new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer()));
final LoggerContext factory = (LoggerContext) LoggerFactory.getILoggerFactory();
final Logger root = factory.getLogger(Logger.ROOT_LOGGER_NAME);
final InstrumentedAppender metrics = new InstrumentedAppender(METRIC_REGISTRY);
metrics.setContext(root.getLoggerContext());
metrics.start();
root.addAppender(metrics);
// final JmxReporter reporter = JmxReporter.forRegistry(METRIC_REGISTRY).build();
// reporter.start();
// String hostName = "192.168.66.29";
// ZabbixSender zabbixSender = new ZabbixSender("https://zabbix.dote.ru/", 10051);
// ZabbixReporter zabbixReporter = ZabbixReporter.forRegistry(METRIC_REGISTRY)
// //.hostName(hostName)
// .prefix("testBe5app.")
// .build(zabbixSender);
//
// zabbixReporter.start(5, TimeUnit.SECONDS);
}
use of com.codahale.metrics.jvm.FileDescriptorRatioGauge in project stdlib by petergeneric.
the class CoreMetricsModule method buildRegistry.
public static MetricRegistry buildRegistry(final boolean includeJvm) {
MetricRegistry registry = new MetricRegistry();
if (includeJvm) {
registry.register(MetricRegistry.name("jvm", "gc"), new GarbageCollectorMetricSet());
registry.register(MetricRegistry.name("jvm", "memory"), new MemoryUsageGaugeSet());
registry.register(MetricRegistry.name("jvm", "thread-states"), new ThreadStatesGaugeSet());
registry.register(MetricRegistry.name("jvm", "fd", "usage"), new FileDescriptorRatioGauge());
}
return registry;
}
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;
}
Aggregations