物业网站建设方案,制作企业网站一般多少钱,手机网站可以直接做百度推广不,建设银行北京市财满街分行网站monitor#xff1a;监控方法的执行情况
监控指定类中方法的执行情况 用来监视一个时间段中指定方法的执行次数#xff0c;成功次数#xff0c;失败次数#xff0c;耗时等这些信息
参数说明
方法拥有一个命名参数 [c:]#xff0c;意思是统计周期#xff08;cycle of ou…monitor监控方法的执行情况
监控指定类中方法的执行情况 用来监视一个时间段中指定方法的执行次数成功次数失败次数耗时等这些信息
参数说明
方法拥有一个命名参数 [c:]意思是统计周期cycle of output拥有一个整型的参数值
参数名称参数说明class-pattern类名表达式匹配method-pattern方法名表达式匹配-E开启正则表达式匹配默认为通配符匹配-c统计周期默认值为120秒
示例 监控demo.MathGame类并且每5S更新一次状态。
monitor *.MathGame primeFactors -c 5执行结果如下:
结果说明
监控项说明timestamp时间戳classJava类method方法构造方法、普通方法total调用次数success成功次数fail失败次数rt平均耗时fail-rate失败率
jad 反编译
jad 反编译代码
jad 包的路径.类名 方法名如果不确定包的路径也可以用 *. 匹配比如 Demo类就是 *.Demo。
示例如下
jad *.MathGame primeFactors结果如下
可以看到反编译后的代码。
[arthas18228]$ jad *.MathGame primeFactorsClassLoader:
-sun.misc.Launcher$AppClassLoader1909752-sun.misc.Launcher$ExtClassLoadera14482Location:
/D:/arthas/math-game.jarpublic ListInteger primeFactors(int number) {
/*44*/ if (number 2) {
/*45*/ this.illegalArgumentCount;throw new IllegalArgumentException(number is: number , need 2);}ArrayListInteger result new ArrayListInteger();
/*50*/ int i 2;
/*51*/ while (i number) {
/*52*/ if (number % i 0) {
/*53*/ result.add(i);
/*54*/ number / i;
/*55*/ i 2;continue;}
/*57*/ i;}
/*61*/ return result;}Affect(row-cnt:1) cost in 103 ms.stack 参数说明
作用输出当前方法被调用的调用路径。
参数名称参数说明class-pattern类名表达式匹配method-pattern方法名表达式匹配condition-express条件表达式-E开启正则表达式匹配默认为通配符匹配-n执行次数限制-m指定 Class 最大匹配数量默认值为 50。
stack查看调用路径
[arthas19440]$ stack *.MathGame primeFactors
Press Q or CtrlC to abort.
Affect(class count: 1 , method count: 1) cost in 63 ms, listenerId: 25
ts2023-06-09 22:57:47;thread_namemain;id1;is_daemonfalse;priority5;TCCLsun.misc.Launcher$AppClassLoader1909752demo.MathGame.primeFactors()at demo.MathGame.run(MathGame.java:24)at demo.MathGame.main(null:-1)根据执行时间来过滤
[arthas19440]$ stack demo.MathGame primeFactors #cost0.5
Press Q or CtrlC to abort.
Affect(class count: 1 , method count: 1) cost in 29 ms, listenerId: 29
ts2023-06-09 23:06:37;thread_namemain;id1;is_daemonfalse;priority5;TCCLsun.misc.Launcher$AppClassLoader1909752demo.MathGame.primeFactors()at demo.MathGame.run(MathGame.java:24)at demo.MathGame.main(null:-1)参考资料
https://blog.csdn.net/lydms/article/details/125238249