Skip to content

ps和 top的CPU使用率定义不一样。是否可以修改一个top的版本 #23

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

Closed
sdslnmd opened this issue Jul 23, 2013 · 1 comment
Assignees

Comments

@sdslnmd
Copy link

sdslnmd commented Jul 23, 2013

ps的cpu使用率和top的cpu使用率计算公式是不一样的。我需要抓一个瞬间增高的CPU使用率。ps取出来的就不正确。希望可以修改成使用top的方式分析CPU使用率。

https://gist.github.com/sdslnmd/6060738
我粗略的写了一个临时用。

@oldratlee
Copy link
Owner

不错!

这样如何?
把使用pstop来获取cpu使用率作为show-busy-java-threads.sh命令的选项,比如 -t|--use-top

@sdslnmd 有时间来改一下show-busy-java-threads.sh不? 😄

PS:
对于瞬间增高的CPU使用率,少数几次的CPU使用率抓取概率上应该看不到。(使用监控系统定时反复抓取,可以加大被观察到的概率。)或者说某个线程有瞬间增高的CPU使用率对整体影响不大,是可以接受的。

你Case的需求是?我再理解一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants