当前位置:网站首页>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
边栏推荐
猜你喜欢
四、机器学习基础
# Arthas 简单使用说明
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme
Install pyqt5 and Matplotlib module
JMeter JDBC batch references data as input parameters (the simplest method for the whole website)
Kubernetes cluster capacity expansion to add node nodes
Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
NATAPP内网穿透
Information Security Experiment 1: implementation of DES encryption algorithm
Network request process
随机推荐
Vs2013 generate solutions super slow solutions
第一讲:包含min函数的栈
nlohmann json
数据建模中利用3σ剔除异常值进行数据清洗
第一讲:鸡蛋的硬度
Leetcode daily questions (2316. count unreachable pairs of nodes in an undirected graph)
Netease cloud wechat applet
消费互联网的产业链其实是很短的,它仅仅承接平台上下游的对接和撮合的角色
4、 Fundamentals of machine learning
Mysql database index study notes
细说Mysql MVCC多版本控制
Network request process
H5 web player easyplayer How does JS realize live video real-time recording?
【SVN】SVN是什么?怎么使用?
What is MD5
Information Security Experiment 2: using x-scanner scanning tool
Lesson 1: hardness of eggs
数据库多表关联查询问题
What development models did you know during the interview? Just read this one
IIS faked death this morning, various troubleshooting, has been solved