Class: EnhanceSwarm::Monitor
- Inherits:
-
Object
- Object
- EnhanceSwarm::Monitor
- Defined in:
- lib/enhance_swarm/monitor.rb
Instance Method Summary collapse
-
#initialize ⇒ Monitor
constructor
A new instance of Monitor.
- #status ⇒ Object
- #watch(interval: nil, timeout: nil) ⇒ Object
Constructor Details
#initialize ⇒ Monitor
Returns a new instance of Monitor.
9 10 11 12 |
# File 'lib/enhance_swarm/monitor.rb', line 9 def initialize @config = EnhanceSwarm.configuration @process_monitor = ProcessMonitor.new end |
Instance Method Details
#status ⇒ Object
22 23 24 25 |
# File 'lib/enhance_swarm/monitor.rb', line 22 def status # Delegate to built-in process monitor @process_monitor.status end |
#watch(interval: nil, timeout: nil) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/enhance_swarm/monitor.rb', line 14 def watch(interval: nil, timeout: nil) interval ||= @config.monitor_interval timeout ||= @config.monitor_timeout # Delegate to built-in process monitor @process_monitor.watch(interval: interval, timeout: timeout) end |