离线 arthas命令trace追踪方法链路 火焰图
1.curl -O https://arthas.aliyun.com/arthas-boot.jar
2.java -jar arthas-boot.jar
Linux环境下使用Arthas定位cpu飙高问题 - qudehu - 博客园 (cnblogs.com)
3.分析代码中的方法 - trace - 方法内部调用路径,并输出方法路径上的每个节点上耗时
trace cn.com.do1.summit.cms.core.service.schedules.impl.ScheduleServiceImpl infoOther -v -n 5 --skipJDKMethod false '1==1' trace cn.com.do1.summit.cms.core.service.guest.impl.GuestServiceImpl listByIds -v -n 5 --skipJDKMethod false '1==1' watch cn.com.do1.summit.cms.core.service.guest.impl.GuestServiceImpl listByIds '{params,returnObj,throwExp}' -v -n 5 -x 3 '1==1' trace cn.com.do1.qiqiao.component.redis.RedisUtil setEx -v -n 5 --skipJDKMethod false '1==1' watch cn.com.do1.qiqiao.component.redis.RedisUtil setEx '{params,returnObj,throwExp}' -v -n 5 -x 3 '1==1' watch cn.com.do1.qiqiao.webhook.client.GeneralFormClient getFormDocumentsByModelCodeAndIds '{params,returnObj,throwExp}' -v -n 5 -x 3 '1==1' trace cn.com.do1.summit.cms.core.service.schedules.impl.ScheduleServiceImpl infoOther -v -n 5 --skipJDKMethod false '1==1' trace cn.com.do1.summit.cms.core.service.schedules.impl.ScheduleTypeServiceImpl infoCache -v -n 5 --skipJDKMethod false '1==1'
用一个例子来演示会更加清晰