-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetty 12 is missing a way to record server latencies #8069
Comments
This actually can be done with the existing wrapper mechanisms by creating a @Override
public Request.Processor handle(Request request) throws Exception
{
long before = System.nanoTime();
Request.Processor processor = super.handle(request);
if (processor == null)
return null;
request.addHttpStreamWrapper(httpStream -> new HttpStream.Wrapper(httpStream)
{
@Override
public void succeeded()
{
super.succeeded();
recordLatency(System.nanoTime() - before);
}
@Override
public void failed(Throwable x)
{
super.failed(x);
recordLatency(System.nanoTime() - before);
}
});
return processor;
} |
@lorban can you make this a utility |
It could have a bunch of overridable methods that correspond to the previous listener events... or is that just adding complexity. |
@gregw won't you still need a |
It could be done with a new listener interface, or just an extendible method to create the stream listener. My preference is to avoid lots of lists of listeners that we must iterate over. |
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
* #8069 add latency recording handler Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Introduced |
Jetty version(s)
12.0.x
Description
12.0.x currently does not have anything equivalent to 11's
HttpChannel.Listener
API which is needed at least to record server latencies with our performance tests.The text was updated successfully, but these errors were encountered: