当前位置:网站首页>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
边栏推荐
- Data association between two interfaces of postman
- flex弹性布局
- 【BW16 应用篇】安信可BW16模组/开发板AT指令实现MQTT通讯
- Regular matching starts with XXX and ends with XXX
- Lesson 1: hardness of eggs
- 面试被问到了解哪些开发模型?看这一篇就够了
- liunx命令
- Pick up the premise idea of programming
- Information Security Experiment 2: using x-scanner scanning tool
- VSCode+mingw64
猜你喜欢
網易雲微信小程序
Jenkins+ant+jmeter use
软件建模与分析
Postman setting environment variables
Colorbar of using vertexehelper to customize controls (II)
第一讲:包含min函数的栈
Difference between interface iterator and iteratable
What development models did you know during the interview? Just read this one
信息安全实验二 :使用X-SCANNER扫描工具
Vs2013 generate solutions super slow solutions
随机推荐
第一讲:包含min函数的栈
sqlplus乱码问题,求解答
Connecting mobile phone with ADB
Unity shader (data type in cghlsl)
如何成为一名高级数字 IC 设计工程师(5-3)理论篇:ULP 低功耗设计技术精讲(下)
浏览器中如何让视频倍速播放
flinkcdc 用sqlclient可以指定mysqlbinlog id执行任务吗
golang select机制和超时问题怎么解决
In fact, it's very simple. It teaches you to easily realize the cool data visualization big screen
How to solve the problem of golang select mechanism and timeout
【frida实战】“一行”代码教你获取WeGame平台中所有的lua脚本
Unity shader (to achieve a simple material effect with adjustable color attributes only)
正则匹配以XXX开头的,XXX结束的
Oracle安装增强功能出错
进程间的通信方式
Windows starts redis service
如何成为一名高级数字 IC 设计工程师(5-2)理论篇:ULP 低功耗设计技术精讲(上)
Unity uses mesh to realize real-time point cloud (I)
IIS faked death this morning, various troubleshooting, has been solved
Impression notes finally support the default markdown preview mode