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

MCOL-1875 - fixed issue with calulating module cpu usage #627

Merged
merged 1 commit into from Nov 16, 2018

Conversation

ghost
Copy link

@ghost ghost commented Nov 16, 2018

No description provided.

@ghost ghost requested a review from pleblanc1976 November 16, 2018 20:08
@@ -556,7 +556,7 @@ void ServerMonitor::getCPUdata()

string tmpsystemCpu = tmpDir + "/processCpu";

cmd = "top -b -n 6 -d 1 | awk '{print $5}' | grep %id > " + tmpsystemCpu;
cmd = "top -b -n 6 -d 1 | grep '%Cpu' | awk '{print $8}' > " + tmpsystemCpu;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of an executable calling an external tool like this (which will not work for everyone) why not read /proc/stat twice and do a calculation on the jiffies?

Copy link
Contributor

@pleblanc1976 pleblanc1976 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an improvement.

@pleblanc1976 pleblanc1976 merged commit 929ae56 into develop Nov 16, 2018
@LinuxJedi LinuxJedi deleted the MCOL-1875 branch March 8, 2019 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants