<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 9, 2018 at 9:58 PM Philippe Marschall &lt;<a href="mailto:kustos@gmx.net">kustos@gmx.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello<br>
<br>
With Java 11 Flight Recorder is now part of OpenJDK 11 [1], Open Source <br>
and free to use. I hacked something together how Undertow could <br>
integrate with this [2]. This can become quite powerful as you can track <br>
down what events happened during processing of that HTTP exchange. It <br>
becomes even more powerful once other components (database, caching) <br>
also generate events and you can correlate them.<br>
<br>
I wanted to ask whether it makes any sense to upstream this? Obviously <br>
it will always have to be optional as it only works with OpenJDK 11+ and <br>
there is a small runtime overhead.<br></blockquote><div><br></div><div>I don&#39;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.</div><div><br></div><div>The runtime overhead is not really an issue as handlers are all optional.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I have to say that I am not super familiar with the Flight Recorder API. <br>
For example I am not sure when an event is started in one thread but <br>
completed in an other thread whether that needs to be handled specially. <br>
I am not sure whether this could happen for async servlet.<br></blockquote><div> </div><div>This can definitely happen, even for non-async servlet, as the request starts in the IO thread and finishes in a worker thread.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also I am not sure whether the ExchangeCompleteListener is called if <br>
handleRequest on the next HttpHandler throws an exception.<br></blockquote><div><br></div><div>ExchangeCompletionListener is always called.</div><div><br></div><div>Stuart</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
  [1] <a href="https://openjdk.java.net/jeps/328" rel="noreferrer" target="_blank">https://openjdk.java.net/jeps/328</a><br>
  [2] <a href="https://github.com/marschall/undertow-jfr" rel="noreferrer" target="_blank">https://github.com/marschall/undertow-jfr</a><br>
<br>
Cheers<br>
Philippe<br>
_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div></div>