This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 4300f357d6 Record the instant the request processing starts.
4300f357d6 is described below
commit 4300f357d60896e6eda07c5395f9b3bf0e6ae58e
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Sep 22 20:44:44 2025 +0100
Record the instant the request processing starts.
---
java/org/apache/coyote/Request.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/java/org/apache/coyote/Request.java
b/java/org/apache/coyote/Request.java
index 378c943458..5123e783dd 100644
--- a/java/org/apache/coyote/Request.java
+++ b/java/org/apache/coyote/Request.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
+import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -166,6 +167,7 @@ public final class Request {
private long bytesRead = 0;
// Time of the request - useful to avoid repeated calls to
System.currentTime
private long startTimeNanos = -1;
+ private Instant startInstant = null;
private long threadId = 0;
private int available = 0;
@@ -748,10 +750,16 @@ public final class Request {
@Deprecated
public void setStartTimeNanos(long startTimeNanos) {
this.startTimeNanos = startTimeNanos;
+ startInstant = Instant.now();
}
public void markStartTime() {
startTimeNanos = System.nanoTime();
+ startInstant = Instant.now();
+ }
+
+ public Instant getStartInstant() {
+ return startInstant;
}
public long getThreadId() {
@@ -861,6 +869,7 @@ public final class Request {
allDataReadEventSent.set(false);
startTimeNanos = -1;
+ startInstant = null;
threadId = 0;
if (hook instanceof NonPipeliningProcessor) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]