
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
sys-cpu
Advanced tools
A Ruby interface for getting cpu information.
gem install sys-cpu
gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/sys-cpu/main/certs/djberg96_pub.pem)
There is no processors iterative method for multi-cpu systems. I was going to
add this originally, but since Solaris is basically dead at this point I've
dropped the idea.
The CPU.model method returns very limited information. I do not yet know
how to get more detailed information.
This is pure Ruby. This version reads information out of /proc/cpuinfo and /proc/loadavg, so if /proc isn't mounted it won't work.
The key-value information in /proc/cpuinfo is stored internally (i.e. in
memory) as an array of hashes when you first require this package. This
overhead is exceptionally minimal, given that your average cpuinfo file
contains less than 1k of text (and I don't store whitespace or newlines).
The text documentation for Linux is dynamically generated during the
build process because the fields vary depending on your setup. So, don't
look at it until after you've installed it. You will see a doc/linux.txt
file after you run rake install (via install.rb).
Unlike other platforms, you can get load averages for an individual cpu in multi-cpu systems. See documentation for more details.
Note that version 0.7.x and later will not work on HP-UX because of the switch to FFI and the lack of a testing platform. However, version 0.6.x will work just fine.
This is a pure Ruby implementation using the win32ole package + WMI. The C version has been scrapped.
As of version 0.5.0, the CPU.usage method has been removed in favor of the
CPU.load_avg method. This does not (currently) use a perf counter, so there
is no longer any delay. Also, the processors method has been added and the
supported method has been dropped. See the documentation for other changes.
Thanks go to the MPlayer team for some source code that helped me on certain versions of FreeBSD in the original C version.
None that I'm aware of. Please report bugs on the project page at:
https://github.com/djberg96/sys-cpu
CPU.processors method.prtdiag shows.Apache-2.0
(C) 2003-2024 Daniel J. Berger, All Rights Reserved
This package is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.
Daniel J. Berger
FAQs
Unknown package
We found that sys-cpu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.