Class: Merb::System::PortablePoller

Inherits:
Object
  • Object
show all
Defined in:
lib/merb-core/rack/adapter/abstract.rb

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ PortablePoller

Returns a new instance of PortablePoller.



4
5
6
# File 'lib/merb-core/rack/adapter/abstract.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/merb-core/rack/adapter/abstract.rb', line 8

def memory
  ps_int('rss')
end

#percent_cpuObject

Percentage CPU usage



18
19
20
# File 'lib/merb-core/rack/adapter/abstract.rb', line 18

def percent_cpu
  ps_float('%cpu')
end

#percent_memoryObject

Percentage memory usage



13
14
15
# File 'lib/merb-core/rack/adapter/abstract.rb', line 13

def percent_memory
  ps_float('%mem')
end