Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] tracking request wait time

On Wed, Feb 15, 2023 at 3:31 PM Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Wed, Feb 15, 2023 at 3:29 PM Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
>
> I am looking for a way to track the time between a request being accepted by Jetty and the request starting processing.
> Is there some listener we could implement to log this time to track down some Gerrit performance issues we are investigating?

https://www.eclipse.org/jetty/documentation/jetty-11/programming-guide/index.html#pg-server-http-channel-events

We tried that and also enabled debug log on AbstractConnection and we found this:

[2023-02-15T16:44:07.580+01:00] [HTTP-56] DEBUG org.eclipse.jetty.io.AbstractConnection : onOpen HttpConnection@9aa795c::SocketChannelEndPoint@4332687d ...
[2023-02-15T16:44:07.580+01:00] [HTTP-56] DEBUG org.eclipse.jetty.io.AbstractConnection : fillInterested HttpConnection@9aa795c::SocketChannelEndPoint@4332687d ...
[2023-02-15T16:44:07.581+01:00] [HTTP-53] DEBUG com.google.gerrit.pgm.http.jetty.JettyHttpChannelListener : [HTTP-53] onRequestBegin Request(GET //localhost:8080/a/accounts/self)@76a10e41
[2023-02-15T16:44:07.581+01:00] [HTTP-53] DEBUG com.google.gerrit.pgm.http.jetty.JettyHttpChannelListener : [HTTP-53] onBeforeDispatch Request(GET //localhost:8080/a/accounts/self)@76a10e41
[2023-02-15T16:44:07.588+01:00] [HTTP-53] DEBUG org.eclipse.jetty.io.AbstractConnection : onClose HttpConnection@9aa795c::SocketChannelEndPoint@4332687d ... 

The events we can listen to via HttpChannel.Listener are all on the worker thread processing the request.
Is there a chance to measure the time between accepting the request on the connection/establishing the connection
and when it's dispatched to the worker thread (onRequestBegin)?

We are interested in that since we sometimes see a large discrepancy between the time logged in haproxy
running in front of Gerrit and the corresponding execution time logged by Gerrit.
Gerrit also supports ssh protocol using Apache Mina sshd and there we can get this wait time between
a request being accepted and the start of processing the request.

-Matthias

Back to the top