Hardware::CPU
CPU related informations of your system.
cpu = Hardware::CPU.new
loop do
sleep 1
p cpu.usage!.to_i # => 17
end
Constructors
Instance methods
guest
Returns the "guest" stat field.
guest_nice
Returns the "guest_nice" stat field.
idle
Returns the "idle" stat field.
iowait
Returns the "iowait" stat field.
irq
Returns the "irq" stat field.
nice
Returns the "nice" stat field.
softirq
Returns the "softirq" stat field.
steal
Returns the "steal" stat field.
system
Returns the "system" stat field.
Returns each CPU usage in percentage based on the previous CPU.
usage!
Like #usage, but mutates the instance.
cpu = Hardware::CPU.new
loop do
sleep 1
p cpu.usage!.to_i # => 17
end
user
Returns the "user" stat field.