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
Issue #5032 - Servlet / WebApp Metrics Listener Support #5033
Issue #5032 - Servlet / WebApp Metrics Listener Support #5033
Conversation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this approach because it is just too invasive and relies on the JIT to elide out lots of extra conditions so that non metric code will not be affected.
Also for filters, this approach is not very suitable as you only get enter/exit events when you really need enter/chain/chained/exit events. So I think the listener API needs work, but you also need to wrap the chain instance passed to each filter.
Also the exit events need to be in finally blocks, so any listeners that want to balance resources or calculate aggregate metrics don't get confused by enters that never exit!
So I still think the approach needs to use wrapping. The SingleThreadedWrapper mechanism in ServletHolder could be generalised and moved to AbstractHandler so that we are able to easily wrap Listeners, Filters and Servlet - both for ones we create ourselves and those that are passed in.
I think it would be perfectly fine for holders to have the concept of the instance (as created or passed in) and a optional wrapper (or onion shells of wrappers) used to execute. This can then be used for a Jetty provided metric mechanism... or users could even just make their own wrappers to do any kind of metric they want... in which case we'd just provide some simple metric examples.
…32-servlet-webapp-metrics-listener
Closing. PR #5273 is the minimal experimental changes to Jetty itself to support this. |
Signed-off-by: Joakim Erdfelt joakim.erdfelt@gmail.com