watch

  • 查看session中的属性

    1. watch *.ApplyInstanceController list '{params[0].request.session.session.attributes.systemUser}' -n 1 -x 3
  • 查看httpServletRequest paramter

    1. watch *.x x 'params[0].request.parameters.paramHashValues.publishCode' -n 4 -x 3
  • 查看ArrayList的第几个数据

    1. watch *.QueryServiceImpl queryIpInfoByGroup '{params[0].get(1)}' -n 3 -x 3
  • 查看目标对象的变量(这里使用的是ognl表达式)

    1. watch *.QueryServiceImpl handle '{target,target.profile}' -n 1 -x 3
  • 查看执行的sql (mysql) 测试坏境不频繁可以使用。 太频繁的获取不到 ```bash watch com.mysql.jdbc.ConnectionImpl execSQL ‘{params[0].originSql}’ -n 5 -x 3 —mysql 驱动

watch org.apache.ibatis.executor.statement.PreparedStatementHandler query ‘{params[0]}’ -n 5 -x 1 ‘params[0].wrapper.asSql().contains(“sql的内容”)’

  1. <a name="GExbS"></a>
  2. ### monitor
  3. - 查看某一个用户的执行频繁
  4. ```bash
  5. monitor *.MyMessageClientListener handleTag "params[0].fourth.{?#this.nick=='vavaxinxin'}" -c 5

ognl

  • 查看静态字段(private,public)

    1. ognl '@io.github.bootmybatis.service.QueryServiceImpl@ddss'

    trace

  • ognl 条件过滤

    1. trace com.raycloud.operation.ons.Tmc.MyMessageClientListener handleRefundCreate -n 5 'params[0].fourth.id=="2525634019"'

    stace

  • 查看堆栈

    vmtool 查看实例数量 or 调用实例方法

    https://arthas.aliyun.com/doc/vmtool#id3

  1. [arthas@94110]$ vmtool --action getInstances --className com.raycloud.api.open.service.open.OpenService -l 1 --express 'instances[0].getProjectDetails()'
  2. @ListApiProjectResponse[
  3. listApiDetails=@ArrayList[isEmpty=false;size=3],
  4. errcode=@Integer[0],
  5. code=@Integer[0],
  6. errmsg=@String[成功],
  7. success=@Boolean[true],
  8. ]
  9. [arthas@94110]$ vmtool --action getInstances --className com.raycloud.api.open.service.open.OpenService -l 1 --express 'instances[0].getProjectDetails()' -x 10
  10. @ListApiProjectResponse[
  11. listApiDetails=@ArrayList[
  12. @ListApiDetail[
  13. projectId=@String[7],
  14. projectName=@String[测试zzz],
  15. categories=@ArrayList[
  16. @Category[com.raycloud.api.common.model.api.document.web.model.resp.ListApiProjectResponse$Category@32ed81c5],
  17. ],
  18. ],
  19. @ListApiDetail[
  20. projectId=@String[10],
  21. projectName=@String[ccccc],
  22. categories=@ArrayList[
  23. @Category[com.raycloud.api.common.model.api.document.web.model.resp.ListApiProjectResponse$Category@ae91d37a],
  24. ],
  25. ],
  26. @ListApiDetail[
  27. projectId=@String[11],
  28. projectName=@String[FFF],
  29. categories=@ArrayList[
  30. @Category[com.raycloud.api.common.model.api.document.web.model.resp.ListApiProjectResponse$Category@2157f8],
  31. ],
  32. ],
  33. ],
  34. errcode=@Integer[0],
  35. code=@Integer[0],
  36. errmsg=@String[成功],
  37. success=@Boolean[true],
  38. ]

vmtool真的强呀