Class: God::System::PortablePoller
- Inherits:
-
Object
- Object
- God::System::PortablePoller
- Defined in:
- lib/god/system/portable_poller.rb
Direct Known Subclasses
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/god/system/portable_poller.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/god/system/portable_poller.rb', line 8 def memory ps_int('rss') end |
#percent_cpu ⇒ Object
Percentage CPU usage
18 19 20 |
# File 'lib/god/system/portable_poller.rb', line 18 def percent_cpu ps_float('%cpu') end |
#percent_memory ⇒ Object
Percentage memory usage
13 14 15 |
# File 'lib/god/system/portable_poller.rb', line 13 def percent_memory ps_float('%mem') end |