Class: Merb::System::PortablePoller
- Defined in:
- lib/merb-core/rack/adapter/abstract.rb
Instance Method Summary collapse
-
#initialize(pid) ⇒ PortablePoller
constructor
A new instance of PortablePoller.
-
#memory ⇒ Object
Memory usage in kilobytes (resident set size).
-
#percent_cpu ⇒ Object
Percentage CPU usage.
-
#percent_memory ⇒ Object
Percentage memory usage.
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
#memory ⇒ Object
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_cpu ⇒ Object
Percentage CPU usage
18 19 20 |
# File 'lib/merb-core/rack/adapter/abstract.rb', line 18 def percent_cpu ps_float('%cpu') end |
#percent_memory ⇒ Object
Percentage memory usage
13 14 15 |
# File 'lib/merb-core/rack/adapter/abstract.rb', line 13 def percent_memory ps_float('%mem') end |