Hi - I have been asked by an application team how the Wily agent calculates the CPU Utilisation % (process) metric.
Is there any lower level detail available about how this component works, for LINUX OS in particular ?
I found the below old wily kb:
Question: How does Linux Platform Monitor calculate the CPU utilization?
Answer: Linux Platform Monitor calculates the CPU usage by the following approach.
It uses getrusage() to get usr and sys CPU time in milliseconds within 1 sec. Then it calculates (usr + sys) / 1000 for the process CPU utilization.
Utilization % (aggregate)
It reads the CPU time for usr, sys, wait, and idle from /proc/stat. Then it calculates (usr + sys) / (usr + sys + wait + idle) for the aggregate CPU utilization.
I hope this helps,
Thanks Sergio, I will pass it on. Cheers
This is the follow up question to CA.
Interesting. So if getrusage() returned 1000ms, Wily would call that 100%. As we can see JVMs exceeding 200% in top, does getrusage () return 2000+ms and Wily truncates this to 100%? It would be good if someone from Wily could confirm this.