Class: Stalin::Watcher::UnixPs
- Inherits:
-
Object
- Object
- Stalin::Watcher::UnixPs
- Defined in:
- lib/stalin/watcher/unix_ps.rb
Instance Method Summary collapse
-
#initialize(pid) ⇒ UnixPs
constructor
A new instance of UnixPs.
-
#watch ⇒ Integer?
Report on memory usage.
Constructor Details
#initialize(pid) ⇒ UnixPs
Returns a new instance of UnixPs.
5 6 7 8 9 10 11 12 13 |
# File 'lib/stalin/watcher/unix_ps.rb', line 5 def initialize(pid) begin ps(Process.pid) rescue StandardError => e raise Stalin::Unsupported, "ps failed: #{e.}" end @pid = pid end |
Instance Method Details
#watch ⇒ Integer?
Report on memory usage.
18 19 20 21 22 |
# File 'lib/stalin/watcher/unix_ps.rb', line 18 def watch ps(@pid) rescue ArgumentError nil end |