diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterBindersConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterBindersConfiguration.java index fbca1256b2..7bd727c22b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterBindersConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterBindersConfiguration.java @@ -37,7 +37,7 @@ import org.springframework.context.annotation.Configuration; class MeterBindersConfiguration { @Bean - @ConditionalOnProperty(value = "spring.metrics.binders.jvmmemory.enabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "spring.metrics.binders.jvmmemory.enabled", matchIfMissing = true) @ConditionalOnMissingBean(JvmMemoryMetrics.class) public JvmMemoryMetrics jvmMemoryMetrics() { return new JvmMemoryMetrics(); @@ -45,21 +45,21 @@ class MeterBindersConfiguration { @Bean @ConditionalOnMissingBean(LogbackMetrics.class) - @ConditionalOnProperty(value = "spring.metrics.binders.logback.enabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "spring.metrics.binders.logback.enabled", matchIfMissing = true) @ConditionalOnClass(name = "ch.qos.logback.classic.Logger") public LogbackMetrics logbackMetrics() { return new LogbackMetrics(); } @Bean - @ConditionalOnProperty(value = "spring.metrics.binders.uptime.enabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "spring.metrics.binders.uptime.enabled", matchIfMissing = true) @ConditionalOnMissingBean(UptimeMetrics.class) public UptimeMetrics uptimeMetrics() { return new UptimeMetrics(); } @Bean - @ConditionalOnProperty(value = "spring.metrics.binders.processor.enabled", havingValue = "true", matchIfMissing = true) + @ConditionalOnProperty(value = "spring.metrics.binders.processor.enabled", matchIfMissing = true) @ConditionalOnMissingBean(ProcessorMetrics.class) public ProcessorMetrics processorMetrics() { return new ProcessorMetrics(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java index 5ae8dbd4fd..d5900dea31 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java @@ -43,6 +43,9 @@ public class SimpleProperties { */ private Duration step = Duration.ofSeconds(10); + /** + * Counting mode. + */ private CountingMode mode = CountingMode.Cumulative; public boolean getEnabled() { @@ -62,10 +65,11 @@ public class SimpleProperties { } public CountingMode getMode() { - return mode; + return this.mode; } public void setMode(CountingMode mode) { this.mode = mode; } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapter.java index 6fe210de9e..d51c5f48c4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesConfigAdapter.java @@ -55,4 +55,5 @@ public class SimplePropertiesConfigAdapter public CountingMode mode() { return get(SimpleProperties::getMode, SimpleConfig.super::mode); } + }