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
参考
阅读 4567 · 发布于 2021-04-27
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓
昵称:
随便看看
换一批
-
PostgreSQL 实现 upsert 插入或者更新功能阅读 407
-
macOS 更改默认打开方式阅读 555
-
Java 中的序列化 Serializable 和 Externalizable阅读 1847
-
Linux 查看系统负载阅读 210
-
面试题:HTTP2.0 与 HTTP1.1 的区别阅读 3927
-
Java 并发编程之 ConcurrentSkipListSet阅读 1240
-
走进 Rust:引用的生命周期阅读 1806
-
Java 中的死锁阅读 1379
-
IDEA Endpoints 微服务工程中根据 URL 快速定位 Controller 类阅读 4117
-
Spring Boot 注入 Filter 过滤器的几种方式阅读 925