Polish "Stop time web metrics when autotime is disabled"

See gh-19981
This commit is contained in:
Stephane Nicoll
2020-02-04 09:58:11 +01:00
parent e323e05eea
commit 10643b7702
3 changed files with 14 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@@ -144,11 +144,11 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
Builder builder = this.autoTimer.builder(this.metricName);
timerSample.stop(getTimer(builder, handler, request, response, exception));
}
return;
}
for (Timed annotation : annotations) {
Builder builder = Timer.builder(annotation, this.metricName);
timerSample.stop(getTimer(builder, handler, request, response, exception));
} else {
for (Timed annotation : annotations) {
Builder builder = Timer.builder(annotation, this.metricName);
timerSample.stop(getTimer(builder, handler, request, response, exception));
}
}
}