Struct cgroupfs::CgroupReader
source · [−]pub struct CgroupReader { /* private fields */ }
Implementations
sourceimpl CgroupReader
impl CgroupReader
pub fn new(root: PathBuf) -> Result<CgroupReader>
pub fn new_with_relative_path(
root: PathBuf,
relative_path: PathBuf
) -> Result<CgroupReader>
pub fn root() -> Result<CgroupReader>
sourcepub fn name(&self) -> &Path
pub fn name(&self) -> &Path
Returns the cgroup name (e.g. the path relative to the cgroup root) Invoking this on the root cgroup will return an empty path
pub fn read_inode_number(&self) -> Result<u64>
sourcepub fn read_memory_current(&self) -> Result<u64>
pub fn read_memory_current(&self) -> Result<u64>
Read memory.current - returning current cgroup memory consumption in bytes
sourcepub fn read_memory_high(&self) -> Result<Option<i64>>
pub fn read_memory_high(&self) -> Result<Option<i64>>
Read memory.high - returning memory.high consumption in bytes Will return -1 if the content is max Will return None if the file is missing
sourcepub fn read_memory_swap_current(&self) -> Result<u64>
pub fn read_memory_swap_current(&self) -> Result<u64>
Read memory.swap.current - returning current cgroup memory swap consumption in bytes
sourcepub fn read_memory_zswap_current(&self) -> Result<u64>
pub fn read_memory_zswap_current(&self) -> Result<u64>
Read memory.zswap.current - returning current cgroup memory zswap consumption in bytes
sourcepub fn read_cpu_stat(&self) -> Result<CpuStat>
pub fn read_cpu_stat(&self) -> Result<CpuStat>
Read cpu.stat - returning assorted cpu consumption statistics
sourcepub fn read_io_stat(&self) -> Result<BTreeMap<String, IoStat>>
pub fn read_io_stat(&self) -> Result<BTreeMap<String, IoStat>>
Read io.stat - returning assorted io consumption statistics
sourcepub fn read_memory_stat(&self) -> Result<MemoryStat>
pub fn read_memory_stat(&self) -> Result<MemoryStat>
Read memory.stat - returning assorted memory consumption statistics
pub fn read_memory_events(&self) -> Result<MemoryEvents>
pub fn read_cgroup_stat(&self) -> Result<CgroupStat>
sourcepub fn read_cpu_pressure(&self) -> Result<CpuPressure>
pub fn read_cpu_pressure(&self) -> Result<CpuPressure>
Read $typ
sourcepub fn read_io_pressure(&self) -> Result<IoPressure>
pub fn read_io_pressure(&self) -> Result<IoPressure>
Read $typ
sourcepub fn read_memory_pressure(&self) -> Result<MemoryPressure>
pub fn read_memory_pressure(&self) -> Result<MemoryPressure>
Read $typ
sourcepub fn read_pressure(&self) -> Result<Pressure>
pub fn read_pressure(&self) -> Result<Pressure>
Read all pressure metrics
sourcepub fn child_cgroup_iter(
&self
) -> Result<impl Iterator<Item = CgroupReader> + '_>
pub fn child_cgroup_iter(
&self
) -> Result<impl Iterator<Item = CgroupReader> + '_>
Return an iterator over child cgroups