對(duì)于java應(yīng)用性能跟蹤其實(shí)有很多種手段,本文只是針對(duì)xrebel的使用做一些簡(jiǎn)單講解(單體應(yīng)用和微服務(wù)應(yīng)用)。分布式跟蹤有很多,比如zipkin等。zipkin太重,不適合開發(fā)階段使用。本文介紹的xrebel是一個(gè)適合小團(tuán)隊(duì)開發(fā)時(shí)期使用的idea(Eclipse)插件。如果對(duì)zipkin想了解,可以參考dubbo分布式系統(tǒng)鏈路追蹤_zipkin.
xrebel下載
- 百度云(內(nèi)含激活文件):鏈接: 鏈接: https://pan.baidu.com/s/1S3Lz0e1xQk-eAiF780NOnA 提取碼: 261k
- 官方地址:https://zeroturnaround.com/software/xrebel/download/
快速安裝
- 下載xrebel.zip, 并解壓到本地,例如:
D:/xrebel。注意路徑中不要有中文不要有空格 - 在tomcat也好,idea,eclipse也好,修改vm 參數(shù),添加
-javaagent:[path/to/xrebel]/xrebel.jar
配置demo
-
idea
image.png -
eclipse
image.png
默認(rèn)是可以試用14天的,建議支持正版,畢竟大家都是吃這行飯的。上述下載方式中百度云里下載包含破解文件。具體破解方式參考下文。
啟動(dòng)項(xiàng)目
1、項(xiàng)目啟動(dòng)時(shí)控制臺(tái)出現(xiàn)如下日志
Connected to the target VM, address: '127.0.0.1:56732', transport: 'socket'
XRebel: Starting logging to file: C:\Users\10400\.xrebel\xrebel.log
2017-12-21 15:40:16 XRebel:
2017-12-21 15:40:16 XRebel: ################################################################
2017-12-21 15:40:16 XRebel:
2017-12-21 15:40:16 XRebel: XRebel 3.1.3 (201607291040)
2017-12-21 15:40:16 XRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tallinn.
2017-12-21 15:40:16 XRebel:
2017-12-21 15:40:16 XRebel: For questions and support, contact xrebel@zeroturnaround.com
2017-12-21 15:40:16 XRebel:
2017-12-21 15:40:16 XRebel: ################################################################
2017-12-21 15:40:16 XRebel:
2017-12-21 15:40:16.719 [auth-service] [main] WARN [com.br.auth.AuthApplication] -啟動(dòng)demo服務(wù)
2017-12-21 15:40:17.027 [auth-service] [restartedMain] WARN [com.br.auth.AuthApplication] -啟動(dòng)demo服務(wù)
...........
2、項(xiàng)目頁(yè)面左下角有如下圖標(biāo)

激活xrebel
jrebel / xrebel 插件激活,親測(cè)可用:
在jrebel /xrebel server處,寫上:
http://139.199.89.239:1008/88414687-3b91-4286-89ba-2dc813b107ce
如果出現(xiàn)激活過(guò)期的情況,請(qǐng)重新生成guid,替換原來(lái)的guid即可
郵箱隨便寫,即可激活。
xrebel 簡(jiǎn)單使用教程
打開 web 服務(wù)頁(yè)面,xrebel會(huì)直接注入到你的頁(yè)面中,左下角會(huì)出現(xiàn)xrebel的toobar,例如:http://localhost:18601?;蛘咄ㄟ^(guò) 訪問服務(wù)/xrebel 打開單獨(dú)頁(yè)面,適用于webservice,restful 等無(wú)頁(yè)面場(chǎng)景。






