Class: OsCtld::Config::CpuScheduler
- Inherits:
-
Object
- Object
- OsCtld::Config::CpuScheduler
- Defined in:
- lib/osctld/config.rb
Instance Attribute Summary collapse
- #enable ⇒ Boolean (also: #enable?) readonly
- #min_package_container_count_percent ⇒ Integer readonly
- #packages ⇒ Hash<Integer, CpuPackage> readonly
Instance Method Summary collapse
-
#initialize(cfg) ⇒ CpuScheduler
constructor
A new instance of CpuScheduler.
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
#enable ⇒ Boolean (readonly) Also known as: enable?
8 9 10 |
# File 'lib/osctld/config.rb', line 8 def enable @enable end |
#min_package_container_count_percent ⇒ Integer (readonly)
12 13 14 |
# File 'lib/osctld/config.rb', line 12 def min_package_container_count_percent @min_package_container_count_percent end |
#packages ⇒ Hash<Integer, CpuPackage> (readonly)
15 16 17 |
# File 'lib/osctld/config.rb', line 15 def packages @packages end |