workhorsy / py-cpuinfo

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

Add socket count #172

Open benjaminlebigot opened 2 years ago

benjaminlebigot commented 2 years ago

Hi,

Thanks for your work, we are using your library to retrieve hardware information which we use to estimate environmental impact of pools of servers. Your work has saved us a lot of time, thanks again.

Adding the socket count retrieved from /proc/cpuinfo.

A patch was needed on the functions: _get_field(), _get_field_actual() in order to retrieve the max value of a given field.

Tests have been adapted and are all passing.

Don't hesitate to contact me for any further information or adaptation.

workhorsy commented 2 years ago

I'm trying to make py-cpuinfo work consistently on every platform (Linux/Windows/OSX/BeOS/Haiku/Solaris). This looks to only gets socket count on Linux. If I add the ability to get socket count, it needs to work consistently on every platform. Plus it looks like it uses curses, which I don't think works on every platform.