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

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

Traits