Class: OsCtld::Container::Lxcfs
- Inherits:
-
Object
- Object
- OsCtld::Container::Lxcfs
show all
- Includes:
- Lockable
- Defined in:
- lib/osctld/container/lxcfs.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Lockable
#exclusively, included, #inclusively, #init_lock, #lock, #unlock
Constructor Details
#initialize(enable: true, loadavg: true, cfs: true) ⇒ Lxcfs
Returns a new instance of Lxcfs.
23
24
25
26
27
28
|
# File 'lib/osctld/container/lxcfs.rb', line 23
def initialize(enable: true, loadavg: true, cfs: true)
init_lock
@enable = enable
@loadavg = loadavg
@cfs = cfs
end
|
Instance Attribute Details
#cfs ⇒ Boolean
21
22
23
|
# File 'lib/osctld/container/lxcfs.rb', line 21
def cfs
@cfs
end
|
#enable ⇒ Boolean
15
16
17
|
# File 'lib/osctld/container/lxcfs.rb', line 15
def enable
@enable
end
|
#loadavg ⇒ Boolean
18
19
20
|
# File 'lib/osctld/container/lxcfs.rb', line 18
def loadavg
@loadavg
end
|
Class Method Details
.load(cfg) ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/osctld/container/lxcfs.rb', line 4
def self.load(cfg)
new(
enable: cfg.fetch('enable', true),
loadavg: cfg.fetch('loadavg', true),
cfs: cfg.fetch('cfs', true),
)
end
|
Instance Method Details
30
31
32
33
34
35
36
|
# File 'lib/osctld/container/lxcfs.rb', line 30
def configure(loadavg: true, cfs: true)
exclusively do
@enable = true
@loadavg = loadavg
@cfs = cfs
end
end
|
#disable ⇒ Object
38
39
40
41
42
|
# File 'lib/osctld/container/lxcfs.rb', line 38
def disable
exclusively do
@enable = false
end
end
|
#dump ⇒ Object
44
45
46
47
48
49
50
51
52
|
# File 'lib/osctld/container/lxcfs.rb', line 44
def dump
inclusively do
{
'enable' => enable,
'loadavg' => loadavg,
'cfs' => cfs,
}
end
end
|
#dup ⇒ Object
54
55
56
57
58
|
# File 'lib/osctld/container/lxcfs.rb', line 54
def dup
ret = super()
ret.init_lock
ret
end
|