亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

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

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

?Alibaba開(kāi)源JAVA診斷工具Arthas

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

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

1)這個(gè)類從哪個(gè) jar 包加載的?為什么會(huì)報(bào)各種類相關(guān)的 Exception?

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

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

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

5)是否有一個(gè)全局視角來(lái)查看系統(tǒng)的運(yùn)行狀況?

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

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

Arthas支持JDK 6+,支持linux/mac/Winodws,采用命令行交互模式,同時(shí)提供豐富的 Tab 自動(dòng)補(bǔ)全功能,進(jìn)一步方便進(jìn)行問(wèn)題的定位和診斷。

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

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

下面介紹arthas的安裝以及簡(jiǎn)單使用

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ù)器某個(gè)目錄,例如/homemkdir arthas
unzip arthas-bin.zip -d arthas
cd arthassh install-local.sh
Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 


Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 


Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

2、啟動(dòng)arthas

1)用as.sh啟動(dòng)

./as.sh

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

2)用arthas-boot啟動(dòng)

java -jar arthas-boot.jar

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

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 


Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

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

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

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

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

Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 


Alibaba開(kāi)源Java診斷工具Arthas簡(jiǎn)單介紹

 

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

網(wǎng)友整理

注冊(cè)時(shí)間:

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

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

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

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

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

答題星2018-06-03

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

全階人生考試2018-06-03

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

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

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

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

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

體育訓(xùn)練成績(jī)?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績(jī)?cè)u(píng)定