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
参考
阅读 1438 · 发布于 2021-04-27
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
PostgreSQL 别名大小写问题阅读 1401
-
走进 Spring Boot 第一步之 Java Properties 类阅读 1613
-
MySQL/Oracle 更新或替换字符串字段中的部分内容阅读 2125
-
走进 Rust:所有权阅读 1030
-
Git commit 提交规范阅读 940
-
Redis 线上禁用命令阅读 1568
-
Chrome 打开开发者工具的几种方法阅读 1295
-
软考-系统架构设计师:处理流程设计阅读 1357
-
Jedis OOM command not allowed when used memory > 'maxmemory'阅读 2054
-
MySQL-Utilities 工具报 TypeError: wrap_socket() got an unexpected keyword argument 'ciphers'阅读 2310