日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長提供免費收錄網(wǎng)站服務(wù),提交前請做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

Alibaba開源Java診斷工具Arthas簡單介紹

 

?Alibaba開源JAVA診斷工具Arthas

Alibaba開源Java診斷工具Arthas簡單介紹

 

Arthas 是Alibaba開源的Java診斷工具,深受開發(fā)者喜愛。在線排查問題,無需重啟;動態(tài)跟蹤Java代碼;實時監(jiān)控JVM狀態(tài)。

當(dāng)你遇到以下類似問題而束手無策時,Arthas可以幫助你解決:

1)這個類從哪個 jar 包加載的?為什么會報各種類相關(guān)的 Exception?

2)我改的代碼為什么沒有執(zhí)行到?難道是我沒 commit?分支搞錯了?

3)遇到問題無法在線上 debug,難道只能通過加日志再重新發(fā)布嗎?

4)線上遇到某個用戶的數(shù)據(jù)處理有問題,但線上同樣無法 debug,線下無法重現(xiàn)!

5)是否有一個全局視角來查看系統(tǒng)的運行狀況?

6)有什么辦法可以監(jiān)控到JVM的實時運行狀態(tài)?

7)怎么快速定位應(yīng)用的熱點,生成火焰圖?

Arthas支持JDK 6+,支持linux/mac/Winodws,采用命令行交互模式,同時提供豐富的 Tab 自動補全功能,進一步方便進行問題的定位和診斷。

Github: https://github.com/alibaba/arthas

文檔: https://alibaba.github.io/arthas/

下面介紹arthas的安裝以及簡單使用

1、下載arthas

在線方式快速安裝

curl -O https://alibaba.github.io/arthas/arthas-boot.jar
java -jar arthas-boot.jar

離線的方式

https://github.com/alibaba/arthas/releases/tag/arthas-all-3.3.6

下載arthas-bin.zip
rz上傳到服務(wù)器某個目錄,例如/homemkdir arthas
unzip arthas-bin.zip -d arthas
cd arthassh install-local.sh
Alibaba開源Java診斷工具Arthas簡單介紹

 


Alibaba開源Java診斷工具Arthas簡單介紹

 


Alibaba開源Java診斷工具Arthas簡單介紹

 

2、啟動arthas

1)用as.sh啟動

./as.sh

Alibaba開源Java診斷工具Arthas簡單介紹

 

2)用arthas-boot啟動

java -jar arthas-boot.jar

選擇應(yīng)用java進程

例如kafka進程是第1個,輸入1回車,Arthas會attach到目標(biāo)進程上

Alibaba開源Java診斷工具Arthas簡單介紹

 

3、help命令查看命令幫助

[arthas@10528]$ help
 NAME         DESCRIPTION                                                                                                                                                      
 help         Display Arthas Help                                                                                                                                              
 keymap       Display all the available keymap for the specified connection.                                                                                                   
 sc           Search all the classes loaded by JVM                                                                                                                             
 sm           Search the method of classes loaded by JVM                                                                                                                       
 classloader  Show classloader info                                                                                                                                            
 jad          Decompile class                                                                                                                                                  
 getstatic    Show the static field of a class                                                                                                                                 
 monitor      Monitor method execution statistics, e.g. total/success/failure count, average rt, fail rate, etc.                                                               
 stack        Display the stack trace for the specified class and method                                                                                                       
 thread       Display thread info, thread stack                                                                                                                                
 trace        Trace the execution time of specified method invocation.                                                                                                         
 watch        Display the input/output parameter, return object, and thrown exception of specified method invocation                                                           
 tt           Time Tunnel                                                                                                                                                      
 jvm          Display the target JVM information                                                                                                                               
 perfcounter  Display the perf counter infornation.                                                                                                                            
 ognl         Execute ognl expression.                                                                                                                                         
 mc           Memory compiler, compiles java files into bytecode and class files in memory.                                                                                    
 redefine     Redefine classes. @see Instrumentation#redefineClasses(ClassDefinition...)                                                                                       
 dashboard    Overview of target jvm's thread, memory, gc, vm, Tomcat info.                                                                                                    
 dump         Dump class byte array from JVM                                                                                                                                   
 heapdump     Heap dump                                                                                                                                                        
 options      View and change various Arthas options                                                                                                                           
 cls          Clear the screen                                                                                                                                                 
 reset        Reset all the enhanced classes                                                                                                                                   
 version      Display Arthas version                                                                                                                                           
 session      Display current session information                                                                                                                              
 sysprop      Display, and change the system properties.                                                                                                                       
 sysenv       Display the system env.                                                                                                                                          
 vmoption     Display, and update the vm diagnostic options.                                                                                                                   
 logger       Print logger info, and update the logger level                                                                                                                   
 history      Display command history                                                                                                                                          
 cat          Concatenate and print files                                                                                                                                      
 echo         write arguments to the standard output                                                                                                                           
 pwd          Return working directory name                                                                                                                                    
 mbean        Display the mbean information                                                                                                                                    
 grep         grep command for pipes.                                                                                                                                          
 tee          tee command for pipes.                                                                                                                                           
 profiler     Async Profiler. https://github.com/jvm-profiling-tools/async-profiler                                                                                            
 stop         Stop/Shutdown Arthas server and exit the console.                                                                                                                [arthas@10528]$ 
Alibaba開源Java診斷工具Arthas簡單介紹

 

4、jvm——查看當(dāng)前 JVM 的信息

Alibaba開源Java診斷工具Arthas簡單介紹

 


Alibaba開源Java診斷工具Arthas簡單介紹

 

5、thread——查看當(dāng)前 JVM 的線程堆棧信息

Alibaba開源Java診斷工具Arthas簡單介紹

 

例如thread -n 3 查看占CPU資源最多的前3個線程

Alibaba開源Java診斷工具Arthas簡單介紹

 

6、dashboard 當(dāng)前系統(tǒng)的實時數(shù)據(jù)面板

Alibaba開源Java診斷工具Arthas簡單介紹

 

更多用法就不一一介紹,具體可以參考https://alibaba.github.io/arthas/官方文檔

7、一圖掌握Arthas—常用命令匯總

若圖片不清晰,請后臺聯(lián)系作者索要高清大圖

或者如下地址下載高清大圖

https://user-images.githubusercontent.com/31468811/71954111-3010be00-321f-11ea-9900-e88195c2a570.png

Alibaba開源Java診斷工具Arthas簡單介紹

 


Alibaba開源Java診斷工具Arthas簡單介紹

 

分享到:
標(biāo)簽:診斷 工具 Java Arthas
用戶無頭像

網(wǎng)友整理

注冊時間:

網(wǎng)站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨大挑戰(zhàn)2018-06-03

數(shù)獨一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運動步數(shù)有氧達人2018-06-03

記錄運動步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績評定2018-06-03

通用課目體育訓(xùn)練成績評定