workhorsy / py-cpuinfo

A module for getting CPU info with pure Python
MIT License
312 stars 59 forks source link

It's not clear what "hz_actual" represents #211

Open jontwo opened 8 months ago

jontwo commented 8 months ago

I've just raised a ticket on pytest-benchmark because of differences in the cpuinfo between two test runs.

It looks like hz_actual is just reporting the first value it finds in /proc/cpuinfo, i.e. a snapshot of one core. Would it be possible to take an average or min/max or something more representative? Here's what I see on my machine, the values change every time I run the command.

$ cat /proc/cpuinfo | grep "MHz"
cpu MHz         : 2979.381
cpu MHz         : 1401.886
cpu MHz         : 4000.000
cpu MHz         : 4000.000
cpu MHz         : 2039.271
cpu MHz         : 1797.567
cpu MHz         : 1483.572
cpu MHz         : 4000.000

In your bug report please include: