1、下载安装
curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar
2、进入art has,查看线程比较消耗cpu
$ thread -n 3
3、查看方法调用耗时
$ stack test.arthas.TestStack doGet
⚠️ 如果返回数据比较多可以根据方法耗时时间进行过滤‘#cost >1.5’$ stack test.arthas.TestStack doGet ‘#cost >1.5’
4、抓取火焰图,比较消耗cpu资源,注意非必要情况 不要在线上环境使用
pod里执行没有内核权限,需要执行profiler start -e itimer