Ctop::Collectors::Proc
Inherits Ctop::Collectors::Base < Reference < Object
Collects process information with CPU usage tracking.
proc = Ctop::Collectors::Proc.new
sleep 1 # Allow baseline to establish
snapshot = proc.collect
snapshot.processes.first(10).each do |p|
puts "#{p.name}: #{p.cpu_percent.round(1)}% CPU, #{p.memory_kb / 1024} MB"
end
Constructors
new
SourceInstance methods
Collect with custom limit on number of processes returned.