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.



6
7
8
# File 'lib/god/system/portable_poller.rb', line 6

def initialize(pid)
  @pid = pid
end

Instance Method Details

#memoryObject

Memory usage in kilobytes (resident set size)



11
12
13
# File 'lib/god/system/portable_poller.rb', line 11

def memory
  ps_int('rss')
end

#percent_cpuObject

Percentage CPU usage



21
22
23
# File 'lib/god/system/portable_poller.rb', line 21

def percent_cpu
  ps_float('%cpu')
end

#percent_memoryObject

Percentage memory usage



16
17
18
# File 'lib/god/system/portable_poller.rb', line 16

def percent_memory
  ps_float('%mem')
end