File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -97,5 +97,8 @@ teeAndCopy() {
97
97
) > $out
98
98
}
99
99
100
- [ ${# args[@]} -eq 0 ] && teeAndCopy ||
101
- " ${args[@]} " | teeAndCopy
100
+ if [ ${# args[@]} -eq 0 ]; then
101
+ teeAndCopy
102
+ else
103
+ " ${args[@]} " | teeAndCopy
104
+ fi
Original file line number Diff line number Diff line change 32
32
用于快速排查` Java ` 的` CPU ` 性能问题(` top us ` 值过高),自动查出运行的` Java ` 进程中消耗` CPU ` 多的线程,并打印出其线程栈,从而确定导致性能问题的方法调用。
33
33
目前只支持` Linux ` 。原因是` Mac ` 、` Windows ` 的` ps ` 命令不支持列出线程线程,更多信息参见[ #33 ] ( https://github.com/oldratlee/useful-scripts/issues/33 ) ,欢迎提供解法。
34
34
35
- PS,如何操作可以参见[ @bluedavy ] ( http://weibo.com/bluedavy ) 的[ 《分布式Java应用》] ( https://book.douban.com/subject/4848587/ ) 的【5.1.1 cpu消耗分析 】一节,说得很详细:
35
+ PS,如何操作可以参见[ @bluedavy ] ( http://weibo.com/bluedavy ) 的[ 《分布式Java应用》] ( https://book.douban.com/subject/4848587/ ) 的【5.1.1 ` CPU ` 消耗分析 】一节,说得很详细:
36
36
37
37
1 . ` top ` 命令找出有问题` Java ` 进程及线程` id ` :
38
38
1 . 开启线程显示模式(` top -H ` ,或是打开` top ` 后按` H ` )
You can’t perform that action at this time.
0 commit comments