Improved toString() adding the age of the request in ms.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2018-02-22 11:17:32 +01:00
parent f8c45b1c6c
commit 8674b05134
1 changed files with 4 additions and 2 deletions

View File

@ -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)