当前位置:网站首页>Arthas simple instructions
Arthas simple instructions
2022-07-07 09:36:00 【Love code meow】
Arthas Simple instructions for use
link :
# Jdk VisualVM Use 、 Threads dump Make analysis
# Idea debugging Debug skill
Arthas Official documents
Arthas
Arthas
yesAlibaba
stay 2018 year 9 Open source in Java The diagnosis Tools . SupportJDK6+
, Use command line interaction mode , ProvideTab
Not fully automatic , It is convenient to locate and diagnose online program running problems .
Arthas Use scenarios
- Is there a global perspective to see the health of the system ?
- Why?
CPU
It's going up again , Where did it take upCPU
? - Does the multithread running have a deadlock ? Is there a jam ?
- The program takes a long time to run , Where does it take longer ? How to monitor ?
- Where does this class come from
jar
Package loaded ? Why do you report all kinds of relatedException
? - Why didn't I change the code to ? I didn't
commit
? The branch is wrong ? - I can't get online when I have a problem
debug
, Can't we just add logs and redistribute them ? - Is there any way to monitor
JVM
The real-time running state of ?
Installing the
download : wget https://alibaba.github.io/arthas/arthas-boot.jar
Download from image :https://arthas.aliyun.com/download/latest_version?mirror=aliyun
start-up :
java -jar arthas-boot.jar
Web Console
:http://127.0.0.1:8563/)
: The operation mode on the page is exactly the same as the console .
Relevant command
command | Introduce |
---|---|
dashboard | Real time data panel of current system |
thread | View the current JVM Thread stack information for |
watch | Methods perform data observation |
trace | Method internal call path , And output the time consumption of each node on the method path |
stack | Output the call path of the current method to be called |
tt | Method to execute the spatiotemporal tunnel of data , Record the input and return information of each call of the specified method , And can observe these different time adjustments |
monitor | Method execution monitoring |
jvm | View the current JVM Information |
vmoption | see , to update JVM Diagnosis related parameters |
sc | see JVM Loaded class information |
sm | View method information for loaded classes |
jad | Decompile specifies the source code of the loaded class |
classloader | see classloader Inheritance tree of ,urls , Class loading information |
heapdump | similar jmap Ordered heap dump function |
Common operations
- Use dashboard Command can overview the program's Threads 、 Memory 、
GC
、 Operating environment information . - Use thread see all Thread information , The... Of each thread will also be listed
CPU
Usage rate
Thread
Parameter name | Parameter description |
---|---|
id | Threads id |
[n:] | Before you designate the busiest N Thread and print stack |
[b] | Find out which threads are currently blocking other threads |
[i <value>] | Appoint cpu Sampling interval for usage statistics , The unit is millisecond , The default value is 200 |
[--all] | Show all matching threads |
thread -b Find the deadlock thread
thread --state blocked
thread -b
The busiest before N Thread and print stack
thread -n 3
Decompile class
Decompile specifies the source code of the loaded class , Check whether the code in the current environment is the latest code
jad com.li.springbootproject.service.thread.impl.ThreadTestServiceImpl
Output to directory :
jad --source-only com.li.springbootproject.service.user.impl.UserServiceImpl > J://Documents//Desktop//UserServiceImpl.java
View class related properties
see
JVM
Loaded class informationsc -d -f com.li.springbootproject.service.thread.impl.ThreadTestServiceImpl
Look at the value of the variable
ognl '@com[email protected]hashSet'
Static variables modify values :
ognl '@com[email protected]hashSet.add("test")'
The viewing method takes time
class-pattern | Class name expression matching |
---|---|
method-pattern | Method name expression matching |
condition-express | Conditional expression |
[E] | Turn on regular expression matching , The default is wildcard matching |
[n:] | Command execution times |
#cost | Method execution time |
Use trace The command can track the statistics method time consuming
trace com.li.springbootproject.service.test.impl.CommonServiceImpl insertDemo
Method execution monitoring
Monitoring item | explain |
---|---|
timestamp | Time stamp |
class | Java class |
method | Method ( Construction method 、 Common method ) |
total | Call the number |
success | Number of successes |
fail | Number of failures |
rt | Average RT |
fail-rate | Failure rate |
monitor -c 5 com.li.springbootproject.controller.test.CommonController test
Observation method information
- Call path :
stack com.UserServiceImpl mysql
Find the corresponding class classloader
sc -d *ThreadTestServiceImpl | grep classLoader
Idea install Arthas plug-in unit
- Installing this plug-in can quickly copy related commands
边栏推荐
- 正则匹配以XXX开头的,XXX结束的
- Difference between interface iterator and iteratable
- Sublime Text4 download the view in bower and set the shortcut key
- iNFTnews | 时尚品牌将以什么方式进入元宇宙?
- flex弹性布局
- Schema-validation: wrong column type encountered in column XXX in table XXX
- Interface test API case, data and interface separation
- Information Security Experiment 2: using x-scanner scanning tool
- JS judge whether checkbox is selected in the project
- 超十万字_超详细SSM整合实践_手动实现权限管理
猜你喜欢
Variable parameter of variable length function
Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
Integer or int? How to select data types for entity classes in ORM
Jenkins modifies the system time
信息安全实验二 :使用X-SCANNER扫描工具
Binary tree high frequency question type
PLC信号处理系列之开关量信号防抖FB
iNFTnews | 时尚品牌将以什么方式进入元宇宙?
# Arthas 简单使用说明
软件建模与分析
随机推荐
Postman setting environment variables
Redis common commands
[4G/5G/6G专题基础-146]: 6G总体愿景与潜在关键技术白皮书解读-1-总体愿景
How to use clipboard JS library implements copy and cut function
Difference between interface iterator and iteratable
如何成为一名高级数字 IC 设计工程师(5-2)理论篇:ULP 低功耗设计技术精讲(上)
Loxodonframework quick start
STM32 and motor development (from stand-alone version to Networking)
JS inheritance prototype
十二、排序
【SVN】SVN是什么?怎么使用?
Difference between process and thread
H5网页播放器EasyPlayer.js如何实现直播视频实时录像?
Postman data driven
沙龙预告|GameFi 领域的瓶颈和解决方案
In fact, it's very simple. It teaches you to easily realize the cool data visualization big screen
Unity uses mesh to realize real-time point cloud (II)
JS逆向教程第一发
Mysql database transaction learning notes
PLC信号处理系列之开关量信号防抖FB