Crate cgroups_fs

Source
Expand description

Cgroup-fs is a minimal wrapper around Linux Control Groups (cgroups) filesystem (usually mounted as /sys/fs/cgroup).

§Examples

§Get memory usage from root cgroup

let root_cgroup = cgroups_fs::CgroupName::new("");
let root_memory_cgroup = cgroups_fs::Cgroup::new(&root_cgroup, "memory");
println!(
    "Current memory usage is {} bytes",
    root_memory_cgroup.get_value::<u64>("memory.usage_in_bytes").unwrap()
);

§Measure memory usage of a child process

Read the CgroupsCommandExt documentation.

Structs§

AutomanagedCgroup
An automatically managed controller of a specific cgroups subsystem.
Cgroup
A controller of a specific cgroups namespace.
CgroupName
A common structure holding a cgroups name (path).

Traits§

CgroupsCommandExt
This trait is designed to extend std::process::Command type with helpers for Cgroups.