当前位置:网站首页>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
边栏推荐
- 華為HCIP-DATACOM-Core_03day
- Postman data driven
- In fact, it's very simple. It teaches you to easily realize the cool data visualization big screen
- Data association between two interfaces of postman
- 数据建模中利用3σ剔除异常值进行数据清洗
- Lesson 1: finding the minimum of a matrix
- esp8266使用TF卡并读写数据(基于arduino)
- 信息安全实验四:Ip包监视程序实现
- 【SVN】SVN是什么?怎么使用?
- **grafana安装**
猜你喜欢
华为HCIP-DATACOM-Core_03day
软件建模与分析
Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
信息安全实验三 :PGP邮件加密软件的使用
二叉树高频题型
答案在哪里?action config/Interceptor/class/servlet
【云原生】DevOps(一):DevOps介绍及Code工具使用
Install pyqt5 and Matplotlib module
VSCode+mingw64+cmake
Pytest installation (command line installation)
随机推荐
liunx命令
Kubernetes cluster capacity expansion to add node nodes
Leetcode daily questions (2316. count unreachable pairs of nodes in an undirected graph)
What development models did you know during the interview? Just read this one
How to use clipboard JS library implements copy and cut function
Final keyword
Strategic cooperation subquery becomes the secret weapon of Octopus web browser
其实特简单,教你轻松实现酷炫的数据可视化大屏
Huawei HCIP - datacom - Core 03 jours
Netease cloud wechat applet
The configuration and options of save actions are explained in detail, and you won't be confused after reading it
数据库多表关联查询问题
Regular matching starts with XXX and ends with XXX
4、 Fundamentals of machine learning
scrapy爬虫mysql,Django等
Jenkins+ant+jmeter use
thinkphp3.2信息泄露
iNFTnews | 时尚品牌将以什么方式进入元宇宙?
csdn涨薪技术-浅学Jmeter的几个常用的逻辑控制器使用
**Grafana installation**