Class: OsCtld::Config::CpuScheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/osctld/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cfg) ⇒ CpuScheduler

Returns a new instance of CpuScheduler.



17
18
19
20
21
22
23
24
# File 'lib/osctld/config.rb', line 17

def initialize(cfg)
  @enable = cfg.fetch('enable', false)
  @min_package_container_count_percent = cfg.fetch('min_package_container_count_percent', 90)
  @packages = Hash[cfg.fetch('packages', {}).map do |k, v|
    pkg = CpuPackage.new(k, v)
    [pkg.id, pkg]
  end]
end

Instance Attribute Details

#enableBoolean (readonly) Also known as: enable?

Returns:

  • (Boolean)


8
9
10
# File 'lib/osctld/config.rb', line 8

def enable
  @enable
end

#min_package_container_count_percentInteger (readonly)

Returns:

  • (Integer)


12
13
14
# File 'lib/osctld/config.rb', line 12

def min_package_container_count_percent
  @min_package_container_count_percent
end

#packagesHash<Integer, CpuPackage> (readonly)

Returns:



15
16
17
# File 'lib/osctld/config.rb', line 15

def packages
  @packages
end