美文网首页
微服务场景下性能问题排查神器之xrebel

微服务场景下性能问题排查神器之xrebel

作者: jackcooper | 来源:发表于2017-12-21 15:55 被阅读245次

    对于java应用性能跟踪其实有很多种手段,本文只是针对xrebel的使用做一些简单讲解(单体应用微服务应用)。分布式跟踪有很多,比如zipkin等。zipkin太重,不适合开发阶段使用。本文介绍的xrebel是一个适合小团队开发时期使用的idea(Eclipse)插件。如果对zipkin想了解,可以参考dubbo分布式系统链路追踪_zipkin.

    xrebel下载

    快速安装

    1. 下载xrebel.zip, 并解压到本地,例如:D:/xrebel注意路径中不要有中文不要有空格
    2. 在tomcat也好,idea,eclipse也好,修改vm 参数,添加 -javaagent:[path/to/xrebel]/xrebel.jar

    配置demo

    • idea


      image.png
    • eclipse


      image.png

    默认是可以试用14天的,建议支持正版,毕竟大家都是吃这行饭的。上述下载方式中百度云里下载包含破解文件。具体破解方式参考下文。

    启动项目

    1、项目启动时控制台出现如下日志

    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] -启动demo服务
    2017-12-21 15:40:17.027 [auth-service] [restartedMain] WARN  [com.br.auth.AuthApplication] -启动demo服务
    ...........
    

    2、项目页面左下角有如下图标


    image.png

    激活xrebel

    demo.gif

    xrebel 简单使用教程

    打开 web 服务页面,xrebel会直接注入到你的页面中,左下角会出现xrebeltoobar,例如:http://localhost:18601。或者通过 访问服务/xrebel 打开单独页面,适用于webservice,restful 等无页面场景。

    image.png image.png image.png image.png image.png

    相关文章

      网友评论

          本文标题:微服务场景下性能问题排查神器之xrebel

          本文链接:https://www.haomeiwen.com/subject/dijawxtx.html