Class: God::System::PortablePoller

Inherits:
Object
  • Object
show all
Defined in:
lib/god/system/portable_poller.rb

Direct Known Subclasses

SlashProcPoller

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ PortablePoller

Returns a new instance of PortablePoller


4
5
6
# File 'lib/god/system/portable_poller.rb', line 4

def initialize(pid)
  @pid = pid
end

Instance Method Details

#memoryObject

Memory usage in kilobytes (resident set size)


8
9
10
# File 'lib/god/system/portable_poller.rb', line 8

def memory
  ps_int('rss')
end

#percent_cpuObject

Percentage CPU usage


18
19
20
# File 'lib/god/system/portable_poller.rb', line 18

def percent_cpu
  ps_float('%cpu')
end

#percent_memoryObject

Percentage memory usage


13
14
15
# File 'lib/god/system/portable_poller.rb', line 13

def percent_memory
  ps_float('%mem')
end