struct Hardware::PID::Stat
- Hardware::PID::Stat
- Struct
- Value
- Object
Overview
Parse stat initialized at Hadware::PID#stat
pid_stat = Hardware::PID::Stat.new
loop do
sleep 1
p pid_stat.cpu_usage! # => 1.5
end
Defined in:
pid/stat.crConstructors
Instance Method Summary
-
#cmajflt : Int64
Returns the "cmajflt" stat field.
-
#cminflt : Int64
Returns the "cminflt" stat field.
- #comm : String
-
#cpu_time(children : Bool = false) : Int64
Returns the CPU time with or without including ones from
children
processes. -
#cpu_usage!(children : Bool = false, current_cpu : CPU = CPU.new) : Float64
Returns the CPU used in percentage.
-
#cstime : Int64
Returns the "cstime" stat field.
-
#cutime : Int64
Returns the "cutime" stat field.
- #data : Array(String)
-
#flags : Int64
Returns the "flags" stat field.
-
#itrealvalue : Int64
Returns the "itrealvalue" stat field.
-
#majflt : Int64
Returns the "majflt" stat field.
-
#minflt : Int64
Returns the "minflt" stat field.
-
#nice : Int64
Returns the "nice" stat field.
-
#numthreads : Int64
Returns the "numthreads" stat field.
- #parse_stat_file
-
#pgrp : Int64
Returns the "pgrp" stat field.
- #pid : Int64
-
#ppid : Int64
Generate methods based on stat Returns the "ppid" stat field.
-
#priority : Int64
Returns the "priority" stat field.
-
#rss : Int64
Returns the "rss" stat field.
-
#session : Int64
Returns the "session" stat field.
-
#starttime : Int64
Returns the "starttime" stat field.
- #state : State
-
#stime : Int64
Returns the "stime" stat field.
-
#tpgid : Int64
Returns the "tpgid" stat field.
-
#tty_nr : Int64
Returns the "tty_nr" stat field.
-
#utime : Int64
Returns the "utime" stat field.
-
#vsize : Int64
Returns the "vsize" stat field.
Constructor Detail
Instance Method Detail
Returns the CPU time with or without including ones from children
processes.
Returns the CPU used in percentage.
pid_stat = Hardware::PID::Stat.new
loop do
sleep 1
p pid_stat.cpu_usage! # => 1.5
end