use of io.micrometer.jmx.JmxMeterRegistry in project zeppelin by apache.
the class ZeppelinServer method initMetrics.
private static void initMetrics(ZeppelinConfiguration conf) {
if (conf.isPrometheusMetricEnabled()) {
promMetricRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
Metrics.addRegistry(promMetricRegistry);
}
if (conf.isJMXEnabled()) {
Metrics.addRegistry(new JmxMeterRegistry(JmxConfig.DEFAULT, Clock.SYSTEM));
}
new ClassLoaderMetrics().bindTo(Metrics.globalRegistry);
new JvmMemoryMetrics().bindTo(Metrics.globalRegistry);
new JvmThreadMetrics().bindTo(Metrics.globalRegistry);
new FileDescriptorMetrics().bindTo(Metrics.globalRegistry);
new ProcessorMetrics().bindTo(Metrics.globalRegistry);
new UptimeMetrics().bindTo(Metrics.globalRegistry);
new JVMInfoBinder().bindTo(Metrics.globalRegistry);
}
use of io.micrometer.jmx.JmxMeterRegistry in project spring-boot by spring-projects.
the class JmxMetricsExportAutoConfigurationTests method stopsMeterRegistryWhenContextIsClosed.
@Test
void stopsMeterRegistryWhenContextIsClosed() {
this.contextRunner.withUserConfiguration(BaseConfiguration.class).run((context) -> {
JmxMeterRegistry registry = context.getBean(JmxMeterRegistry.class);
assertThat(registry.isClosed()).isFalse();
context.close();
assertThat(registry.isClosed()).isTrue();
});
}
Aggregations