Skip to content

Commit bfb4cde

Browse files
committed
Merge pull request #31516 from jakubskalak
* pr/31516: Update copyright year of changed files Add missing descriptions for HTTP Server and Data repositories metrics Closes gh-31516
2 parents 0ef213a + 628a7b0 commit bfb4cde

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/data/MetricsRepositoryMethodInvocationListener.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -83,8 +83,9 @@ public void afterInvocation(RepositoryMethodInvocation invocation) {
8383
Set<Timed> annotations = TimedAnnotations.get(invocation.getMethod(), invocation.getRepositoryInterface());
8484
Iterable<Tag> tags = this.tagsProvider.repositoryTags(invocation);
8585
long duration = invocation.getDuration(TimeUnit.NANOSECONDS);
86-
AutoTimer.apply(this.autoTimer, this.metricName, annotations, (builder) -> builder.tags(tags)
87-
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
86+
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
87+
(builder) -> builder.description("Duration of repository invocations").tags(tags)
88+
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
8889
}
8990

9091
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -109,7 +109,8 @@ private void record(ServerWebExchange exchange, Throwable cause, long start) {
109109
Iterable<Tag> tags = this.tagsProvider.httpRequestTags(exchange, cause);
110110
long duration = System.nanoTime() - start;
111111
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
112-
(builder) -> builder.tags(tags).register(this.registry).record(duration, TimeUnit.NANOSECONDS));
112+
(builder) -> builder.description("Duration of HTTP server request handling").tags(tags)
113+
.register(this.registry).record(duration, TimeUnit.NANOSECONDS));
113114
}
114115
catch (Exception ex) {
115116
logger.warn("Failed to record timer metrics", ex);

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -158,7 +158,8 @@ private Set<Timed> getTimedAnnotations(Object handler) {
158158

159159
private Timer getTimer(Builder builder, Object handler, HttpServletRequest request, HttpServletResponse response,
160160
Throwable exception) {
161-
return builder.tags(this.tagsProvider.getTags(request, response, handler, exception)).register(this.registry);
161+
return builder.description("Duration of HTTP server request handling")
162+
.tags(this.tagsProvider.getTags(request, response, handler, exception)).register(this.registry);
162163
}
163164

164165
/**

0 commit comments

Comments
 (0)