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

#initialize(type) ⇒ ResourceManager

Initializes the ResourceManager with a matching adapter

Raises:

  • (ArgumentError)


32
33
34
35
36
37
38
39
40
# File 'lib/wf_node_api/resource_manager.rb', line 32

def initialize(type)
  @resman = nil

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

Instance Method Details

#total_cpu_coresInteger

Returns the total number of cpu cores available on the system

Returns:

  • (Integer)


45
46
47
# File 'lib/wf_node_api/resource_manager.rb', line 45

def total_cpu_cores
  @resman.total_cpu_cores
end