Skip to content

Commit b17cb9b

Browse files
izeyesnicoll
authored andcommitted
Polish gh-31231
See gh-31540
1 parent 7c55639 commit b17cb9b

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public class HealthEndpointProperties extends HealthProperties {
4242
/**
4343
* Health endpoint groups.
4444
*/
45-
private Map<String, Group> group = new LinkedHashMap<>();
45+
private final Map<String, Group> group = new LinkedHashMap<>();
4646

47-
private Logging logging = new Logging();
47+
private final Logging logging = new Logging();
4848

4949
@Override
5050
public Show getShowDetails() {
@@ -139,7 +139,7 @@ public static class Logging {
139139
/**
140140
* Threshold after which a warning will be logged for slow health indicators.
141141
*/
142-
Duration slowIndicatorThreshold = Duration.ofSeconds(10);
142+
private Duration slowIndicatorThreshold = Duration.ofSeconds(10);
143143

144144
public Duration getSlowIndicatorThreshold() {
145145
return this.slowIndicatorThreshold;

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public HealthEndpoint(HealthContributorRegistry registry, HealthEndpointGroups g
6666
* @param groups the health endpoint groups
6767
* @param slowIndicatorLoggingThreshold duration after which slow health indicator
6868
* logging should occur
69+
* @since 2.6.9
6970
*/
7071
public HealthEndpoint(HealthContributorRegistry registry, HealthEndpointGroups groups,
7172
Duration slowIndicatorLoggingThreshold) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointSupport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ abstract class HealthEndpointSupport<C, T> {
5252

5353
private final HealthEndpointGroups groups;
5454

55-
private Duration slowIndicatorLoggingThreshold;
55+
private final Duration slowIndicatorLoggingThreshold;
5656

5757
/**
5858
* Create a new {@link HealthEndpointSupport} instance.
@@ -177,7 +177,7 @@ private T getLoggedHealth(C contributor, String name, boolean showDetails) {
177177
if (duration.compareTo(this.slowIndicatorLoggingThreshold) > 0) {
178178
String contributorClassName = contributor.getClass().getName();
179179
Object contributorIdentifier = (!StringUtils.hasLength(name)) ? contributorClassName
180-
: contributor.getClass().getName() + " (" + name + ")";
180+
: contributorClassName + " (" + name + ")";
181181
logger.warn(LogMessage.format("Health contributor %s took %s to respond", contributorIdentifier,
182182
DurationStyle.SIMPLE.print(duration)));
183183
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpointWebExtension.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public HealthEndpointWebExtension(HealthContributorRegistry registry, HealthEndp
6666
* @param groups the health endpoint groups
6767
* @param slowIndicatorLoggingThreshold duration after which slow health indicator
6868
* logging should occur
69+
* @since 2.6.9
6970
*/
7071
public HealthEndpointWebExtension(HealthContributorRegistry registry, HealthEndpointGroups groups,
7172
Duration slowIndicatorLoggingThreshold) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/ReactiveHealthEndpointWebExtension.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public ReactiveHealthEndpointWebExtension(ReactiveHealthContributorRegistry regi
6666
* @param groups the health endpoint groups
6767
* @param slowIndicatorLoggingThreshold duration after which slow health indicator
6868
* logging should occur
69+
* @since 2.6.9
6970
*/
7071
public ReactiveHealthEndpointWebExtension(ReactiveHealthContributorRegistry registry, HealthEndpointGroups groups,
7172
Duration slowIndicatorLoggingThreshold) {

spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ In the preceding example, the health information is available in an entry named
769769

770770
TIP: Health indicators are usually called over HTTP and need to respond before any connection timeouts.
771771
Spring Boot will log a warning message for any health indicator that takes longer than 10 seconds to respond.
772-
If you want to configure this threshold, you can use the configprop:management.endpoint.health.logging.slow-indicator-threshold[] property
772+
If you want to configure this threshold, you can use the configprop:management.endpoint.health.logging.slow-indicator-threshold[] property.
773773

774774
In addition to Spring Boot's predefined {spring-boot-actuator-module-code}/health/Status.java[`Status`] types, `Health` can return a custom `Status` that represents a new system state.
775775
In such cases, you also need to provide a custom implementation of the {spring-boot-actuator-module-code}/health/StatusAggregator.java[`StatusAggregator`] interface, or you must configure the default implementation by using the configprop:management.endpoint.health.status.order[] configuration property.

0 commit comments

Comments
 (0)