Crates.io | cgroups-fs |
lib.rs | cgroups-fs |
version | 1.1.3 |
source | src |
created_at | 2018-12-27 00:31:42.661201 |
updated_at | 2022-06-12 07:08:05.050221 |
description | Rust bindings to Linux Control Groups (cgroups). |
homepage | |
repository | https://github.com/frol/cgroups-fs |
max_upload_size | |
id | 103976 |
size | 27,165 |
Native Rust library for managing Linux Control Groups (cgroups).
This crate, curently, only supports the original, V1 hierarchy. You are welcome to contribute Cgroups V2 support.
First, add the following to your Cargo.toml
:
[dependencies]
cgroups-fs = "1.0"
Next, use it in your crate:
use cgroups_fs;
use cgroups_fs;
let my_cgroup = cgroups_fs::CgroupName("my-cgroup");
let my_cpu_cgroup = cgroups_fs::Cgroup::init(&my_cgroup, "cpu")?;
println!(
"The current CPU shares in `my-cgroup` control group is {}",
my_cpu_cgroup.get_value::<u64>("cpu.shares")
);
Please, find more examples in the documentation.
This project is licensed under either of
at your option.