This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 79d9f431c4 Fix back-port 79d9f431c4 is described below commit 79d9f431c40e3a33a00446ea254e0415c2d2b475 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Aug 14 18:04:24 2023 +0100 Fix back-port --- java/org/apache/catalina/core/StandardWrapperValve.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/core/StandardWrapperValve.java b/java/org/apache/catalina/core/StandardWrapperValve.java index c48a01460c..9fdf78f4d9 100644 --- a/java/org/apache/catalina/core/StandardWrapperValve.java +++ b/java/org/apache/catalina/core/StandardWrapperValve.java @@ -19,6 +19,7 @@ package org.apache.catalina.core; import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; @@ -63,7 +64,7 @@ final class StandardWrapperValve extends ValveBase { // Some JMX statistics. This valve is associated with a StandardWrapper. // We expose the StandardWrapper as JMX ( j2eeType=Servlet ). The fields // are here for performance. - private final LongAdder processingTime = new LongAdder(); + private final AtomicLong processingTime = new AtomicLong(); private volatile long maxTime; private volatile long minTime = Long.MAX_VALUE; private final AtomicInteger requestCount = new AtomicInteger(0); @@ -238,7 +239,7 @@ final class StandardWrapperValve extends ValveBase { long t2 = System.currentTimeMillis(); long time = t2 - t1; - processingTime.add(time); + processingTime.getAndAdd(time); if (time > maxTime) { maxTime = time; } @@ -278,7 +279,7 @@ final class StandardWrapperValve extends ValveBase { } public long getProcessingTime() { - return processingTime.sum(); + return processingTime.get(); } public long getMaxTime() { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org