eclipse / jifa

🔬 Online Heap Dump, GC Log, Thread Dump & JFR File Analyzer.
https://eclipse.github.io/jifa/
Eclipse Public License 2.0
541 stars 96 forks source link

Small suggestions for thread dump analysis and optimization #259

Closed mark8s closed 8 months ago

mark8s commented 8 months ago

That's right, I found that if my thread-dump log content contains some useless information, there will be problems with the parsed results.Because most of my services have skywalkjing sidecar injected into them, it will output its startup log here.

For example, like this:

DEBUG 2024-03-07 17:02:18.692 main AgentPackagePath : The beacon class location is jar:file:/opt/skywalking/agent/skywalking-agent.jar!/org/apache/skywalking/apm/agent/core/boot/AgentPackagePath.class. 
INFO 2024-03-07 17:02:19.218 main AgentClassLoader : /opt/skywalking/agent/plugins/apm-httpasyncclient-4.x-plugin-8.15.0.jar loaded. 
INFO 2024-03-07 17:02:19.220 main AgentClassLoader : /opt/skywalking/agent/plugins/apm-spring-core-patch-8.15.0.jar loaded. 
INFO 2024-03-07 17:02:19.339 main AgentClassLoader : /opt/skywalking/agent/plugins/jsonrpc4j-1.x-plugin-8.15.0.jar loaded. 
INFO 2024-03-07 17:02:19.340 main AgentClassLoader : /opt/skywalking/agent/plugins/apm-xxl-job-2.x-plugin-8.15.0.jar loaded. 
onaut-http-server-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.398 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/jedis-4.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.398 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-pulsar-2.2-2.7-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.398 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-kafka-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.399 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/tomcat-10x-plugin-8.15.0.jar!/skywalking-plugin.def 
skywalking/agent/plugins/apm-resttemplate-3.x-plugin-8.15.0.jar!/skywalking-plugin.def 
solver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-nutz-mvc-annotation-1.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.408 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-lettuce-5.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.408 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-influxdb-2.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.408 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/graphql-12.x-15.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.409 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-httpasyncclient-4.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.409 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-spring-core-patch-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.409 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-struts2-2.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.410 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-mongodb-2.x-plugin-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.410 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/plugins/apm-servicecomb-java-chassis-2.x-plugin-8.15.0.jar!/skywalking-plugin.def FO 2024-03-07 17:02:19.431 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/activations/apm-toolkit-trace-activation-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.432 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/activations/apm-toolkit-log4j-2.x-activation-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.432 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/activations/apm-toolkit-micrometer-activation-8.15.0.jar!/skywalking-plugin.def 
INFO 2024-03-07 17:02:19.432 main PluginResourcesResolver : find skywalking plugin define in jar:file:/opt/skywalking/agent/activations/apm-toolkit-webflux-activation-8.15.0.jar!/skywalking-plugin.def 
2024-03-07 17:02:27
Full thread dump OpenJDK 64-Bit Server VM (25.111-b14 mixed mode):

"Keep-Alive-Timer" #1705882 daemon prio=8 os_prio=0 tid=0x00007f8c00003000 nid=0x1c33 waiting on condition [0x00007f8b93cd8000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at sun.net.www.http.KeepAliveCache.run(KeepAliveCache.java:172)
    at java.lang.Thread.run(Thread.java:745)

   Locked ownable synchronizers:
    - None

The interface effect is as follows:

image

I think it can be optimized.

D-D-H commented 8 months ago

Maybe we can add pre-processing to find the header of the threap dump content.

D-D-H commented 8 months ago

It would be nice if you were willing to implement it.

mark8s commented 8 months ago

@D-D-H I want to implement it, but I'm not good at java... :smile:

D-D-H commented 8 months ago

Okay. Could I ask you about the scenarios where you use Jifa?

mark8s commented 8 months ago

@D-D-H In fact, it is offline Java application diagnosis. I know that Alibaba has an ATP diagnosis platform. We just do similar functions, which are basically sufficient for use.

mark8s commented 8 months ago

@D-D-H Will a recent update support this?

D-D-H commented 8 months ago

@D-D-H Will a recent update support this?

I might consider this in May or June.

mark8s commented 8 months ago

@D-D-H ok