Class: ResourceManager

Inherits:
Object
  • Object
show all
Defined in:
lib/wf_node_api/resource_manager.rb

Overview

Top level class for resource management

Instance Method Summary (collapse)

Constructor Details

- (ResourceManager) initialize(type)

Initializes the ResourceManager with a matching adapter

Raises:

  • (ArgumentError)


36
37
38
39
40
41
42
43
44
# File 'lib/wf_node_api/resource_manager.rb', line 36

def initialize(type)
  @resman = nil

  if type == 'linux'
    @resman = ResourceManagerAdapter::Linux.new
  else
    raise ArgumentError, 'invalid resourcemanager type supplied'
  end
end

Instance Method Details

- (Integer) total_cpu_cores

Returns the total number of cpu cores available on the system

Returns:

  • (Integer)


49
50
51
# File 'lib/wf_node_api/resource_manager.rb', line 49

def total_cpu_cores
  @resman.total_cpu_cores
end