Class: Phantom::Collector
- Inherits:
-
Object
- Object
- Phantom::Collector
- Defined in:
- lib/phantom/collector.rb
Class Method Summary collapse
- .get_running_instances ⇒ Object
- .missing_ports ⇒ Object
- .on_port(port) ⇒ Object
- .required_ports ⇒ Object
Class Method Details
.get_running_instances ⇒ Object
11 12 13 14 |
# File 'lib/phantom/collector.rb', line 11 def get_running_instances lines = running_phantoms_shell_output.split("\n") parse_processes lines end |
.missing_ports ⇒ Object
16 17 18 |
# File 'lib/phantom/collector.rb', line 16 def missing_ports required_ports - get_running_instances.map(&:port) end |
.on_port(port) ⇒ Object
7 8 9 |
# File 'lib/phantom/collector.rb', line 7 def on_port(port) get_running_instances.find {|p| p.port == port} end |
.required_ports ⇒ Object
20 21 22 |
# File 'lib/phantom/collector.rb', line 20 def required_ports (Cfg.phantom_base_port..(Cfg.phantom_base_port+Cfg.phantom_processes_number-1)).to_a end |