1、 Arthas 学习

启动arthas

  • curl -O https://alibaba.github.io/arthas/arthas-boot.jar
  • java -jar arthas-boot.jar
  • 启动成功


    image.png

sc 查找全限定名

sc *xxx

trace 方法耗时分析

trace com.xxx.xxx.MyClass myMthod
增加条件耗时过滤 trace demo.MathGame run '#cost > 10'
打印jdk 耗时 trace --skipJDKMethod false demo.MathGame run

image.png

watch

watch com.xxx.xx.MyClass myMethod "{params,target,returnObj}" -x 2
耗时过滤 watch demo.MathGame primeFactors '{params, returnObj}' '#cost>200' -x 2
入参过滤 watch demo.MathGame primeFactors "{params[0],target}" "params[0]<0"

image.png

https://arthas.aliyun.com/doc/

你可能感兴趣的:(1、 Arthas 学习)