oracle / visualvm

VisualVM is an All-in-One Java Troubleshooting Tool
https://visualvm.github.io/
Other
2.89k stars 305 forks source link

Extract JFR information from Linux Command Line #592

Open tricnex opened 3 months ago

tricnex commented 3 months ago

Hello, First of all, thanks to all the developers who continue to keep this project alive. I would like to ask if there is a way to extract information from a JFR file via the command line. My JFR file is generated automatically during the execution of software I wrote. Through the GUI on the Sampler Tab, I can see all the processes that have been executed, along with their respective functions, execution times, and CPU usage. Is it possible to get the same information in a text file extracted via the command line? I need to extract this information dynamically during the mass execution of my software to check if execution times and resource usage remain consistent. Thank you very much for your support. Marco

thurka commented 3 months ago

I guess you can try to use JDK command line utility jfr. https://docs.oracle.com/en/java/javase/21/docs/specs/man/jfr.html

tricnex commented 3 months ago

Hi Thurka, Thank you for your response.

I used the jfr command to first extract the summary of events and then for each event, the related stack trace. I was able to identify what I was looking for, but my problem remains as I don't have a correlation with the CPU time used. Below, I will provide the output from the jfr command with the related stack trace and the output from the VisualVM software with the specific information I am looking for.

Is there a way to extract the information directly from the VisualVM software? If the information is already displayed in the GUI, can it also be estracted via CLI? Output from JFR Command VisualVm