-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show-busy-java-threads#__top_threadId_cpu在top v3.2下提取不正确 #71
Comments
@geekMessi 实现后自己测试了多次。 给一下
另外,如果上面的你问题定位对的,已经缩到上面的范围, # Check point 1
top -H -b -d 0.5 -n 2
# Check point 2
top -H -b -d 0.5 -n 2 | tee top.out |
awk '{
if (idx == 3 && $NF == "java") # $NF is command
# only print 4th text block(idx == 3), aka. process info of second top update
print $1 " " $9 # $1 is thread id, $9 is %cpu
if ($0 == "")
idx++
}' 可能性比较大的原因 是 不同环境/版本的Top输出格式 和 我的不一致。 @geekMessi PS:
Top一次输出 有2段(汇总信息 和 进程信息)。 这些原因在代码注释中有说明到: useful-scripts/show-busy-java-threads Lines 296 to 305 in 0b03b02
分段运行一下上面命令也可以看出来。 |
环境信息:
output:
top.out
|
给一下 top的输出, 即 可以 在 oldratlee/useful-scripts - gitter.im 即时聊 |
问题已和 @geekMessi 确定: 两次Top的输出之间, 期待 @geekMessi 的 |
写了个实现,Fix了一下, #72 show-duplicate-java-classes support command name jsvc to find java process feature 你试试是不是 OK 的? ❤️ @geekMessi |
@oldratlee |
@geekMessi OK 🎉 |
这部分逻辑是不是有些问题?为什么只抓4th? 执行了一下,没有输出
改成下面是OK的
awk语句
The text was updated successfully, but these errors were encountered: