This commit is contained in:
Phillip Webb
2018-02-13 14:40:52 -08:00
parent d238a31d3d
commit 6771cc9674
18 changed files with 50 additions and 58 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.metrics.config;
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.core.instrument.config.MissingRequiredConfigurationException;

View File

@@ -68,8 +68,8 @@ public class RabbitMetricsAutoConfiguration {
ConnectionFactory rabbitConnectionFactory = connectionFactory
.getRabbitConnectionFactory();
String connectionFactoryName = getConnectionFactoryName(beanName);
new RabbitMetrics(rabbitConnectionFactory,
Tags.of("name", connectionFactoryName)).bindTo(this.registry);
new RabbitMetrics(rabbitConnectionFactory, Tags.of("name", connectionFactoryName))
.bindTo(this.registry);
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -69,8 +69,8 @@ public class DataSourcePoolMetricsAutoConfiguration {
private void bindDataSourceToRegistry(String beanName, DataSource dataSource) {
String dataSourceName = getDataSourceName(beanName);
new DataSourcePoolMetrics(dataSource, this.metadataProviders,
dataSourceName, Collections.emptyList()).bindTo(this.registry);
new DataSourcePoolMetrics(dataSource, this.metadataProviders, dataSourceName,
Collections.emptyList()).bindTo(this.registry);
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -41,8 +41,7 @@ class MongoHealthIndicatorConfiguration extends
private final Map<String, MongoTemplate> mongoTemplates;
MongoHealthIndicatorConfiguration(
Map<String, MongoTemplate> mongoTemplates) {
MongoHealthIndicatorConfiguration(Map<String, MongoTemplate> mongoTemplates) {
this.mongoTemplates = mongoTemplates;
}

View File

@@ -75,5 +75,6 @@ org.springframework.boot.actuate.autoconfigure.web.jersey.JerseyManagementChildC
org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementChildContextConfiguration,\
org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementChildContextConfiguration,\
org.springframework.boot.actuate.autoconfigure.web.servlet.WebMvcEndpointChildContextConfiguration
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.actuate.autoconfigure.metrics.config.MissingRequiredConfigurationFailureAnalyzer
org.springframework.boot.actuate.autoconfigure.metrics.MissingRequiredConfigurationFailureAnalyzer

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.metrics.config;
package org.springframework.boot.actuate.autoconfigure.metrics;
import io.micrometer.core.instrument.Clock;
import io.micrometer.newrelic.NewRelicConfig;

View File

@@ -47,8 +47,7 @@ public class RabbitMetricsAutoConfigurationTests {
@Test
public void rabbitmqNativeConnectionFactoryInstrumentationCanBeDisabled() {
this.contextRunner
.withPropertyValues("management.metrics.enable.rabbitmq=false")
this.contextRunner.withPropertyValues("management.metrics.enable.rabbitmq=false")
.run((context) -> {
MeterRegistry registry = context.getBean(MeterRegistry.class);
assertThat(registry.find("rabbitmq.connections").meter()).isNull();

View File

@@ -88,8 +88,7 @@ public class DataSourcePoolMetricsAutoConfigurationTests {
context.getBean("secondOne", DataSource.class).getConnection()
.getMetaData();
MeterRegistry registry = context.getBean(MeterRegistry.class);
registry.get("jdbc.max.connections").tags("name", "first")
.meter();
registry.get("jdbc.max.connections").tags("name", "first").meter();
registry.get("jdbc.max.connections").tags("name", "secondOne")
.meter();
});

View File

@@ -39,8 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class MongoReactiveHealthIndicatorConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(
MongoAutoConfiguration.class,
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class,
MongoDataAutoConfiguration.class,
MongoReactiveAutoConfiguration.class,
MongoReactiveDataAutoConfiguration.class,
@@ -49,10 +48,10 @@ public class MongoReactiveHealthIndicatorConfigurationTests {
@Test
public void runShouldCreateIndicator() {
this.contextRunner.run(
(context) -> assertThat(context).hasSingleBean(MongoReactiveHealthIndicator.class)
.doesNotHaveBean(MongoHealthIndicator.class)
.doesNotHaveBean(ApplicationHealthIndicator.class));
this.contextRunner.run((context) -> assertThat(context)
.hasSingleBean(MongoReactiveHealthIndicator.class)
.doesNotHaveBean(MongoHealthIndicator.class)
.doesNotHaveBean(ApplicationHealthIndicator.class));
}
@Test