Arthas 使用 monitor 在指定时间段内统计方法的调用次数、平均返回时间等
Arthas Java 大约 2092 字monitor 命令
-c
:指定时间段,默认120
秒。
-c 10
表示统计在指定的10
秒内,方法执行了多少次、平均返回时间等信息。
monitor com.example.arthas.controller.Test111Controller test1 -c 10
输出:
[arthas@21776]$ monitor com.example.arthas.controller.Test111Controller test1 -c 10
Press Q or Ctrl+C to abort.
Affect(class count: 1 , method count: 1) cost in 37 ms, listenerId: 38
timestamp class method total success fail avg-rt(ms) fail-rate
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
2021-02-12 20:21:12 com.example.arthas.controller.Test11 test1 18 18 0 0.39 0.00%
1Controller
timestamp class method total success fail avg-rt(ms) fail-rate
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
2021-02-12 20:21:22 com.example.arthas.controller.Test11 test1 0 0 0 0.00 0.00%
1Controller
timestamp class method total success fail avg-rt(ms) fail-rate
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
2021-02-12 20:21:32 com.example.arthas.controller.Test11 test1 0 0 0 0.00 0.00%
1Controller
更多用法
在10
秒内统计,第一个参数传入方法时小于等于2
的情况。
monitor com.example.arthas.controller.Test111Controller test1 "params[0] <= 2" -c 10 -b
参考
阅读 2692 · 发布于 2021-04-27
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Linux 命令之查看进程启动时间阅读 2050
-
PHP 生成重复固定随机数邀请码阅读 2126
-
为什么 ArrayList 父类中已经实现了 List 接口,自身也实现了 List 接口阅读 747
-
MySQL 之延迟键写入 DELAY_KEY_WRITE阅读 2441
-
Android SharedPreferences 工具类阅读 3174
-
npm 设置镜像阅读 1771
-
OpenResty 返回中文乱码问题阅读 4796
-
nginx: [emerg] unknown directive "if($request_uri" in阅读 5664
-
iframe 直接加载 HTML 代码阅读 1494
-
Linux 编译安装 Nginx阅读 3600