arthas icon indicating copy to clipboard operation
arthas copied to clipboard

增加jfr命令,支持jfr分析功能[阿里巴巴编程之夏2022]

Open hengyunabc opened this issue 3 years ago • 3 comments

2022 Alibaba Summer of Code

Welcome to the open source world! If you haven't planned how to spend this summer, come to the Alibaba Summer of Code and code with us! 💻 Alibaba Summer of Code is a global program focused on engaging students directly in open source software development. Under the guidance of the mentor in the Alibaba open source project, students can experience software development in the real world. Alibaba Summer of code will begin from May 30th to September 1st. Students can use the summertime to participate in the open source project and work with the core members of the project.

What you can get?

On this exclusive developer journey, students will have the opportunity to: ● Participate in the top projects of the International Open Source Foundation; ● Get a scholarship from Alibaba; ● Obtain an open source contributor certificate; ● Get a fast pass of Alibaba Internship ● Get your code adopted and used by the open source project!

Our Mentor

@hengyunabc 断岭

Timeline

image

Apply Now!

  1. Browse open idea list here:

    • https://github.com/alibaba/arthas/issues/2189
  2. Upload your CV and project proposal via ASOC 2022 official website

    https://opensource.alibaba.com/asoc2022

Contact the Organizer

If you have any questions, visit the event website:https://opensource.alibaba.com/asoc2022 Email address: [email protected]

  • Arthas开源交流钉钉群: 21965291 ,搜索群号即可加入。

  • https://arthas.aliyun.com/doc/contact-us.html


阿里巴巴编程之夏2022任务。

  • https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/about.htm#JFRUH170
  1. 通过jfr命令,生成各种JFR结果
  2. 可以分析jfr结果,生成可视化页面

hengyunabc avatar May 24 '22 10:05 hengyunabc

补充说明:

  • 在JDK8的比较新的版本里,jfr已经默认集成了。用户在代码里就可以直接开启JFR。
  • arthas的jfr命令,就是通过调用JDK的jfr API,生成jfr结果文件。最简单的功能自然是start/stop。 另外,通过不同的参数,支持生成各种类型的jfr结果。
  • 更进一步,可以对jfr结果文件分析,可以考虑单独一个模块做一个解析jfr文件,生成html结果的功能。

  • https://docs.oracle.com/javase/9/docs/api/jdk.jfr-summary.html
  • https://docs.oracle.com/en/java/javase/11/docs/api/jdk.jfr/module-summary.html

hengyunabc avatar Jun 27 '22 07:06 hengyunabc

补充说明:

  • 在JDK8的比较新的版本里,jfr已经默认集成了。用户在代码里就可以直接开启JFR。
  • arthas的jfr命令,就是通过调用JDK的jfr API,生成jfr结果文件。最简单的功能自然是start/stop。 另外,通过不同的参数,支持生成各种类型的jfr结果。
  • 更进一步,可以对jfr结果文件分析,可以考虑单独一个模块做一个解析jfr文件,生成html结果的功能。

hengyunabc avatar Jun 27 '22 07:06 hengyunabc

先说JFR的功能,可以参考下网上的文章: https://www.cnblogs.com/flydean/p/jdk14-jfr-jmc-event-stream.html

  • jfr 最简单的是 start/stop/dump 。 另外具体获取哪些 jfr event,是有一个配置文件的,也可以在命令行指定。

再说JFR分析功能。

  • 分析功能不在命令行处理(在命令行里也很难展示)。应该在单独的代码里处理,再转换为 api,再可以据 api 得到一些网页可视化的结果。

  • 这里可以参考JMC。 JMC可以看做是一个GUI版本的jfr分析软件,我们可以参考它做一个Web版本的。 当然因为时间/能力等因素,我们可以先从简单的做起,先把 JMC简单的分析功能Web化。

hengyunabc avatar Jun 27 '22 11:06 hengyunabc