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
Structs§
- Automanaged
Cgroup - An automatically managed controller of a specific cgroups subsystem.
- Cgroup
- A controller of a specific cgroups namespace.
- Cgroup
Name - A common structure holding a cgroups name (path).
Traits§
- Cgroups
Command Ext - This trait is designed to extend
std::process::Command
type with helpers for Cgroups.