Class: OffTheGrid::ExecuteHost

Inherits:
Host
  • Object
show all
Defined in:
lib/off_the_grid/execute_host.rb

Overview

A class to represent SGE Execute Hosts

Instance Attribute Summary

Attributes inherited from Host

#hostname

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Host

#initialize, #name, #name=

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

.listObject

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

#detailsObject



9
10
11
# File 'lib/off_the_grid/execute_host.rb', line 9

def details
  `qconf -se #{name}`.chomp
end

#host_groupsObject

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_scalingObject



13
14
15
# File 'lib/off_the_grid/execute_host.rb', line 13

def load_scaling
  extract_detail(:load_scaling).last
end

#load_valuesObject



17
18
19
# File 'lib/off_the_grid/execute_host.rb', line 17

def load_values
  extract_detail(:load_values)
end

#processorsObject



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