I'm starting JFR at launch by specifying the following CLI options to the Java program under test:
-Xmx24g -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,settings=profile
The test execution takes 90 seconds to complete.
After opening the JFR dump in Java Mission Control, the Call Tree tab in JMC looks like this:
There is less than 1 sample per second. That makes the detail drill-down, Hot Methods and Overview tabs effectively useless. After initial investigation it was determined the method sampling is set to the default of 10ms, and, as it turns out, this unexpected result is because ~98% of the 90 seconds are spent waiting on socket I/O while performing various different database reads, so I'm only getting method samples for the other ~2% of the time.
How can I include I/O-bound samples in the method time, in order to help locate the trace that's spending the most time waiting for database results? The process contains database queries in multiple places, which in turn are called from multiple other places, so guessing at the slow call path is not easy.