Java flight recorder programmatically parsing

2019-02-27 11:45发布

I'm trying to Parse JFR dump using JAVA. I followed this blog, http://hirt.se/blog/?p=446 . But these methods are deprecated now. Is there any supported parsers for JFR to JAVA? if not can you point me is it possible to retrieve data from JFR dump?

2条回答
贪生不怕死
2楼-- · 2019-02-27 12:35

As Klara mentioned, there is no officially supported parser. Hopefully the JFR parser will be supported officially in JDK 9. For now, you can use the APIs mentioned in Hirt's blog. Don't worry about those being deprecated. :)

I have successfully used JFR parser in my jfr-flame-graph project. Please note that my project uses Maven and the JFR parsers are not available in Maven Central (or any other repository). Therefore the "Step 1" in the README is important and it'll copy JFR parser jars to a local repository and you can use those jars as dependencies in your pom.xml

I hope this helps.

查看更多
放荡不羁爱自由
3楼-- · 2019-02-27 12:50

There is currently no supported parser. There are however many people both inside and outside of Oracle who are using the parsers mentioned in that blog post quite successfully.

There will possibly be a supported parser in the future, there will certainly be changes to the parser, I'm just no sure if it will be "supported" or not. But the code you are writing now should work just fine with JDK 7 and 8 flight recordings, and will not will with JDK 9 recordings.

查看更多
登录 后发表回答