On Sun, Dec 9, 2018 at 9:58 PM Philippe Marschall <kustos@gmx.net> wrote:
Hello

With Java 11 Flight Recorder is now part of OpenJDK 11 [1], Open Source
and free to use. I hacked something together how Undertow could
integrate with this [2]. This can become quite powerful as you can track
down what events happened during processing of that HTTP exchange. It
becomes even more powerful once other components (database, caching)
also generate events and you can correlate them.

I wanted to ask whether it makes any sense to upstream this? Obviously
it will always have to be optional as it only works with OpenJDK 11+ and
there is a small runtime overhead.

I don't know if this would be worth it at the moment, as this would mean that Undertow would require JDK11 to build. It does look like a useful handler though. The next major version of Undertow is likely to require JDK11, so maybe we could consider it then.

The runtime overhead is not really an issue as handlers are all optional.
 

I have to say that I am not super familiar with the Flight Recorder API.
For example I am not sure when an event is started in one thread but
completed in an other thread whether that needs to be handled specially.
I am not sure whether this could happen for async servlet.
 
This can definitely happen, even for non-async servlet, as the request starts in the IO thread and finishes in a worker thread.
 
Also I am not sure whether the ExchangeCompleteListener is called if
handleRequest on the next HttpHandler throws an exception.

ExchangeCompletionListener is always called.

Stuart
 


  [1] https://openjdk.java.net/jeps/328
  [2] https://github.com/marschall/undertow-jfr

Cheers
Philippe
_______________________________________________
undertow-dev mailing list
undertow-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev