Arthas

Arthas 是Alibaba开源的Java诊断工具,深受开发者喜好html

 

下载&启动java

wget https://alibaba.github.io/arthas/arthas-boot.jar

启动git

java -jar arthas-boot.jar

查看日志github

cat ~/logs/arthas/arthas.log

Web控制台工具

http://127.0.0.1:8563

查看帮助ui

java -jar arthas-boot.jar -h

快速开始spa

下载demo并启动线程

wget https://alibaba.github.io/arthas/arthas-demo.jar
java -jar arthas-demo.jar

启动arthas3d

查看dashboard日志

经过thread命令来获取到arthas-demo进程的Main Class

经过jad来反编译Main Class

退出arthas

若是只是退出当前的链接,能够用quit或者exit命令

若是想彻底退出arthas,能够执行shutdown命令

文档

https://github.com/alibaba/arthas

https://alibaba.github.io/arthas/index.html

https://alibaba.github.io/arthas/install-detail.html

https://alibaba.github.io/arthas/quick-start.html

https://alibaba.github.io/arthas/advanced-use.html

https://alibaba.github.io/arthas/commands.html

实战演练

# 查看占CPU资源最多的前3个线程
thread -n 3

# 观察方法执行的时候哪一个子调用比较慢
trace com.xxx.cms.story.controller.product.ProductController list

# 监控某个特殊方法的调用统计数据,包括总调用次数,平均rt,成功率等信息,每隔5秒输出一次
monitor -c 5 com.xxx.cms.story.controller.product.ProductController list

相关文章
相关标签/搜索