javajfr

Find application method average execution time?


I have a Spring Batch application packaged as a JAR file as highlighted below

java -Xms2048m -Xmx2048m -Ddivision=25 -Ddate= -Denv=dv -Dconn=45 -jar demo-jobs*.jar job-definition.xml jobName -next

I want to optimize the overall execution time, so I'm trying to trace the average execution time for all the methods. I am using Java Flight Recorder.

I could see the execution percentage, but not the average execution time.

enter image description here

In the Oracle documentation - https://docs.oracle.com/javase/10/troubleshoot/troubleshoot-performance-issues-using-jfr.htm#JSTGD307 - they showed the methods with their execution time.

enter image description here

However, I don't see anything in the "Contention" tab

enter image description here

What am I missing? Why is it not showing the methods and their execution time as shown in the Oracle article?


Solution

  • To keep overhead reasonable (less than 1%), latency/contention related events are only recorded if they exceed a threshold, by default 20 ms.

    You can set the threshold to 0 ms in the wizard, when you start a recording, but beware there can be an enormous number of events.