-
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Daniel Berger edited this page Apr 23, 2023
·
4 revisions
A Ruby library for gathering Linux kernel statistics out of /proc/stat.
gem install linux-kstat
If you have trouble installing this gem via bundler, please try this:
bundle config specific_platform true
Then attempt to install again.
# require 'linux-kstat' will also work
require 'linux/kstat'
kstat = Linux::Kstat.new
p kstat[:cpu]
p kstat[:procs_running]
The values for most of the keys are a single numeric value. However, in the case of "cpu" keys, the result is a 7 element hash of numeric values. In the case of the "intr" key, the value is an array containing the list of interrupts.
See linuxhowto for more information about the meaning of each of the fields.