Usually time reported by RequestTimer (which is a servlet listener) and RequestLogger (which is taken from Jetty) matches up to a millisecond. Sometimes it doesn't though, with RequestLogger reporting a much longer request time. This time gap may be an indicator of a client on a slow network or a general network congestion.
So let's poke around Jetty source code to confirm this hypothesis, and as we start exposing request times in metrics and healthchecks (#83), we should probably measure both, and also their delta:
t0: RequestTimer time - application time to finish the request
t1: RequestLogger time - includes t0 plus any extra time spent in Jetty (does it include the time spent in request queue as well?)
t1 - t0 : if bigger than a few ms, there's likely a network issue.
Usually time reported by
RequestTimer(which is a servlet listener) andRequestLogger(which is taken from Jetty) matches up to a millisecond. Sometimes it doesn't though, withRequestLoggerreporting a much longer request time. This time gap may be an indicator of a client on a slow network or a general network congestion.So let's poke around Jetty source code to confirm this hypothesis, and as we start exposing request times in metrics and healthchecks (#83), we should probably measure both, and also their delta:
t0: RequestTimer time - application time to finish the requestt1: RequestLogger time - includest0plus any extra time spent in Jetty (does it include the time spent in request queue as well?)t1 - t0: if bigger than a few ms, there's likely a network issue.