Module: OsCtl::Lib::CGroup
- Defined in:
- lib/libosctl/cgroup.rb
Defined Under Namespace
Classes: PathReader
Constant Summary collapse
- FS =
'/sys/fs/cgroup'.freeze
Class Method Summary collapse
- .v1? ⇒ Boolean
- .v2? ⇒ Boolean
-
.version ⇒ 1, 2
Cgroup hierarchy version.
Class Method Details
.v1? ⇒ Boolean
18 19 20 |
# File 'lib/libosctl/cgroup.rb', line 18 def self.v1? version == 1 end |
.v2? ⇒ Boolean
22 23 24 |
# File 'lib/libosctl/cgroup.rb', line 22 def self.v2? version == 2 end |
.version ⇒ 1, 2
Returns cgroup hierarchy version.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/libosctl/cgroup.rb', line 6 def self.version return @version if @version @version = if File.exist?(File.join(FS, 'cgroup.procs')) 2 else 1 end @version end |