Struct cgroupfs::CgroupReader

source ·
pub struct CgroupReader { /* private fields */ }

Implementations§

source§

impl CgroupReader

source

pub fn new(root: PathBuf) -> Result<CgroupReader>

source

pub fn new_with_relative_path( root: PathBuf, relative_path: PathBuf ) -> Result<CgroupReader>

source

pub fn root() -> Result<CgroupReader>

source

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

source

pub fn read_inode_number(&self) -> Result<u64>

source

pub fn read_cgroup_controllers(&self) -> Result<BTreeSet<String>>

Read cgroup.controllers

source

pub fn read_cgroup_subtree_control(&self) -> Result<BTreeSet<String>>

Read cgroup.subtree_control

source

pub fn read_pids_current(&self) -> Result<u64>

Read pids.current - returning current cgroup number of processes

source

pub fn read_pids_max(&self) -> Result<i64>

Read pids.max - returning max cgroup number of processes

source

pub fn read_memory_min(&self) -> Result<i64>

Read memory.min - returning memory.min limit in bytes Will return -1 if the content is max

source

pub fn read_memory_low(&self) -> Result<i64>

Read memory.low - returning memory.low limit in bytes Will return -1 if the content is max

source

pub fn read_memory_high(&self) -> Result<i64>

Read memory.high - returning memory.high limit in bytes Will return -1 if the content is max

source

pub fn read_memory_max(&self) -> Result<i64>

Read memory.max - returning memory.max max in bytes Will return -1 if the content is max

source

pub fn read_memory_swap_max(&self) -> Result<i64>

Read memory.swap.max - returning memory.swap.max max in bytes Will return -1 if the content is max

source

pub fn read_memory_zswap_max(&self) -> Result<i64>

Read memory.zswap.max - returning memory.zswap.max max in bytes Will return -1 if the content is max

source

pub fn read_memory_current(&self) -> Result<u64>

Read memory.current - returning current cgroup memory consumption in bytes

source

pub fn read_memory_swap_current(&self) -> Result<u64>

Read memory.swap.current - returning current cgroup memory swap consumption in bytes

source

pub fn read_memory_zswap_current(&self) -> Result<u64>

Read memory.zswap.current - returning current cgroup memory zswap consumption in bytes

source

pub fn read_cpu_stat(&self) -> Result<CpuStat>

Read cpu.stat - returning assorted cpu consumption statistics

source

pub fn read_io_stat(&self) -> Result<BTreeMap<String, IoStat>>

Read io.stat - returning assorted io consumption statistics

source

pub fn read_memory_stat(&self) -> Result<MemoryStat>

Read memory.stat - returning assorted memory consumption statistics

source

pub fn read_memory_events(&self) -> Result<MemoryEvents>

source

pub fn read_cgroup_stat(&self) -> Result<CgroupStat>

source

pub fn read_cpu_weight(&self) -> Result<u32>

Read cpu.weight

source

pub fn read_cpu_max(&self) -> Result<CpuMax>

Read cpu.max

source

pub fn read_cpuset_cpus(&self) -> Result<Cpuset>

Read cpuset.cpus

source

pub fn read_cpuset_cpus_effective(&self) -> Result<Cpuset>

Read cpuset.cpus.effective

source

pub fn read_cpuset_cpus_partition(&self) -> Result<String>

Read cpuset.cpus.partition

source

pub fn read_cpuset_mems(&self) -> Result<MemNodes>

Read cpuset.mems

source

pub fn read_cpuset_mems_effective(&self) -> Result<MemNodes>

Read cpuset.mems.effective

source

pub fn read_cpu_pressure(&self) -> Result<CpuPressure>

Read $typ

source

pub fn read_io_pressure(&self) -> Result<IoPressure>

Read $typ

source

pub fn read_memory_pressure(&self) -> Result<MemoryPressure>

Read $typ

source

pub fn read_pressure(&self) -> Result<Pressure>

Read all pressure metrics

source

pub fn read_memory_numa_stat(&self) -> Result<BTreeMap<u32, MemoryNumaStat>>

source

pub fn child_cgroup_iter( &self ) -> Result<impl Iterator<Item = CgroupReader> + '_>

Return an iterator over child cgroups

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.