Class: OffTheGrid::ExecuteHost
- Defined in:
- lib/off_the_grid/execute_host.rb
Overview
A class to represent SGE Execute Hosts
Instance Attribute Summary
Attributes inherited from Host
Class Method Summary collapse
-
.list ⇒ Object
Get the list of SGE execute hosts.
Instance Method Summary collapse
- #details ⇒ Object
-
#host_groups ⇒ Object
very slow method for now.
- #load_scaling ⇒ Object
- #load_values ⇒ Object
- #processors ⇒ Object
Methods inherited from Host
Methods included from GridResource
#<=>, #delete, #extract_detail, #new?, #save, #validate_before_delete, #validate_before_save
Constructor Details
This class inherits a constructor from OffTheGrid::Host
Class Method Details
.list ⇒ Object
Get the list of SGE execute hosts
5 6 7 |
# File 'lib/off_the_grid/execute_host.rb', line 5 def self.list `qconf -sel`.chomp.split("\n").sort.collect { |name| new(name) } end |
Instance Method Details
#details ⇒ Object
9 10 11 |
# File 'lib/off_the_grid/execute_host.rb', line 9 def details `qconf -se #{name}`.chomp end |
#host_groups ⇒ Object
very slow method for now
27 28 29 |
# File 'lib/off_the_grid/execute_host.rb', line 27 def host_groups HostGroup.list.select { |group| group.hosts.include?(self) } end |
#load_scaling ⇒ Object
13 14 15 |
# File 'lib/off_the_grid/execute_host.rb', line 13 def load_scaling extract_detail(:load_scaling).last end |
#load_values ⇒ Object
17 18 19 |
# File 'lib/off_the_grid/execute_host.rb', line 17 def load_values extract_detail(:load_values) end |
#processors ⇒ Object
21 22 23 24 |
# File 'lib/off_the_grid/execute_host.rb', line 21 def processors value = extract_detail(:processors).last value =~ /[0-9]+/ ? Integer(value) : value end |