From 8674b05134e404994035845da525fa77733c4c2b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 22 Feb 2018 11:17:32 +0100 Subject: [PATCH] Improved toString() adding the age of the request in ms. Signed-off-by: Simone Bordet --- .../src/main/java/org/eclipse/jetty/server/HttpChannel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index 0876f977536..0ccfabb26b4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -615,13 +615,15 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor @Override public String toString() { - return String.format("%s@%x{r=%s,c=%b,a=%s,uri=%s}", + long timeStamp = _request.getTimeStamp(); + return String.format("%s@%x{r=%s,c=%b,a=%s,uri=%s,age=%d}", getClass().getSimpleName(), hashCode(), _requests, _committed.get(), _state.getState(), - _request.getHttpURI()); + _request.getHttpURI(), + timeStamp == 0 ? 0 : System.currentTimeMillis() - timeStamp); } public void onRequest(MetaData.Request request)