arthas idea plugin 配置

 

配置

为什么有配置项?第一个原因是spring static context 这个配置的需求,第二个是功能越来越多了有小伙伴有特殊的需求然后就增加的处理。配置是基于 project 级别 //2020-08-15 杭州

配置的大图

  • 剪切板场景复制的shell 脚本非常大,可以本地构造一个文件粘贴 处理。

 

配置项说明

spring static context

static context 配置静态的spring context 帮助获取spring context 实例,进而可以快速的调用spring bean的方法、获取spring 环境变量等功能都依赖这个配置。

demo 工程中 @com.wangji92.arthas.plugin.demo.common.ApplicationContextProvider@context 静态的 spring context 信息的配置 demo 中有这个配置的链接,可以使用 Static Ognl Grammar Help Watch Static Content 这个命令生成,放置在静态的 context 这里

 

 

invokeCount

生成命令 trace watch tt等等命令的次数限制

trace com.wangji92.arthas.plugin.demo.controller.CommonController traceException -n 5

invokeMonitorCount

Monitor 调用次数的限制

monitor com.wangji92.arthas.plugin.demo.controller.CommonController traceException -n 10 --cycle 10

invokeMonitorInterval

Monitor 调用时间的限制 --cycle 次数和时间之间选择都行

monitor com.wangji92.arthas.plugin.demo.controller.CommonController traceException -n 10 --cycle 10

depthPrintProperty -x

watch 、ognl、tt 查看值展示结果的深度

watch com.wangji92.arthas.plugin.demo.controller.CommonController traceException '{params,returnObj,throwExp}' -n 5 -x 3 

 

conditionExpressDisplay

默认情况下 会生成一个 '1==1'的表达式过滤条件 用于提醒使用者知道还有 评估这个功能,arthas 入门到精通 详细讲解了 arthas 核心参数和ognl之间的处理关系,这样就可以处理各种各样的过滤需求。默认生成的可以去掉,下一次生成不会有这个'1==1'

trace com.wangji92.arthas.plugin.demo.controller.CommonController anonymousClass -n 5 '1==1' --skipJDKMethod false

关闭的效果

trace com.wangji92.arthas.plugin.demo.controller.CommonController anonymousClass -n 5  --skipJDKMethod false

traceSkipJdk

这个 和 conditionExpressDisplay 一样的  --skipJDKMethod false 是否要跳过jdk 默认方法,trace 计算耗死的时候 发现不知道哪里耗时这么多,可能就是  --skipJDKMethod false 这个参数没有,默认是关闭的 。

关闭 的效果

trace com.wangji92.arthas.plugin.demo.controller.CommonController anonymousClass -n 5  --skipJDKMethod false

打开的效果

trace com.wangji92.arthas.plugin.demo.controller.CommonController anonymousClass -n 5 
posted @ 2022-01-24 09:58  ArielMeng  阅读(340)  评论(0编辑  收藏  举报