1

I am following the psutil doc to get the average system load over the last 1 minute. I am using the [x / psutil.cpu_count() * 100 for x in psutil.getloadavg()], rounded to 1 decimal place (i.e. [round(x / psutil.cpu_count() * 100, 1) for x in psutil.getloadavg()]).

Sometimes I get values exceeding 100% (e.g. 120% - 130%), does that make any sense or it is because of the round?

EDIT

I just realised that the Hyper Thread CPUs are excluded which could result in >100%, right?

question_1
  • 102
  • 1
  • 10

1 Answers1

0

I see exactly the same behaviour. round() is not causing the problem. psutil.cpu_count() already returns number of physical + logical CPU's. So Hyper Threading is already taken into account. I suspect psutil.getloadavg()having an issue. Or I got something wrong from their documentation, although it is actually clearly described: psutil docs: getloadavg()

e'ke
  • 31
  • 2