Java 飞行记录器以编程方式解析

Java flight recorder programmatically parsing

我正在尝试使用 JAVA 解析 JFR 转储。 我关注了这个博客 http://hirt.se/blog/?p=446 。 但这些方法现在已被弃用。 JFR 是否有支持的解析器到 JAVA?如果不能,你能指出我是否可以从 JFR 转储中检索数据?

目前没有支持的解析器。 然而,Oracle 内部和外部都有许多人非常成功地使用该博客中提到的解析器 post。

将来可能会有一个支持的解析器,解析器肯定会有变化,我只是不确定它是否会是"supported"。 但是您现在编写的代码应该可以很好地处理 JDK 7 和 8 次飞行记录,而不会处理 JDK 9 次记录。

作为 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。不要担心那些被弃用的。 :)

我已经在 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

中成功使用了 JFR 解析器

希望对您有所帮助。