Skip to content
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

Double count Guest Time in Total CPU Time #18

Closed
jimmyxian opened this issue Jan 30, 2019 · 0 comments
Closed

Double count Guest Time in Total CPU Time #18

jimmyxian opened this issue Jan 30, 2019 · 0 comments

Comments

@jimmyxian
Copy link

When running Virtual Machine(KVM) in host, I find that the value of host cpu usage is different between falcon agent and top cmd. Actually, falcon agent use nux package to calculate cpu usage.
https://github.com/open-falcon-archive/agent/blob/master/funcs/cpustat.go#L19

In Linux Kernel, User time is already include Guest Time. So when read cpu info from /proc/stat, we should not add guest time once more.

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/kernel/sched/cputime.c#n138

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

No branches or pull requests

1 participant