Struct cgroups_rs::blkio::BlkIoController[][src]

pub struct BlkIoController { /* fields omitted */ }

A controller that allows controlling the blkio subsystem of a Cgroup.

In essence, using the blkio controller one can limit and throttle the tasks’ usage of block devices in the control group.

Implementations

impl BlkIoController[src]

pub fn new(root: PathBuf, v2: bool) -> Self[src]

Constructs a new BlkIoController with root serving as the root of the control group.

pub fn blkio(&self) -> BlkIo[src]

Gathers statistics about and reports the state of the block devices used by the control group’s tasks.

pub fn set_leaf_weight(&self, w: u64) -> Result<()>[src]

Set the leaf weight on the control group’s tasks, i.e., how are they weighted against the descendant control groups’ tasks.

pub fn set_leaf_weight_for_device(
    &self,
    major: u64,
    minor: u64,
    weight: u64
) -> Result<()>
[src]

Same as set_leaf_weight(), but settable per each block device.

pub fn reset_stats(&self) -> Result<()>[src]

Reset the statistics the kernel has gathered so far and start fresh.

pub fn throttle_read_bps_for_device(
    &self,
    major: u64,
    minor: u64,
    bps: u64
) -> Result<()>
[src]

Throttle the bytes per second rate of read operation affecting the block device major:minor to bps.

pub fn throttle_read_iops_for_device(
    &self,
    major: u64,
    minor: u64,
    iops: u64
) -> Result<()>
[src]

Throttle the I/O operations per second rate of read operation affecting the block device major:minor to bps.

pub fn throttle_write_bps_for_device(
    &self,
    major: u64,
    minor: u64,
    bps: u64
) -> Result<()>
[src]

Throttle the bytes per second rate of write operation affecting the block device major:minor to bps.

pub fn throttle_write_iops_for_device(
    &self,
    major: u64,
    minor: u64,
    iops: u64
) -> Result<()>
[src]

Throttle the I/O operations per second rate of write operation affecting the block device major:minor to bps.

pub fn set_weight(&self, w: u64) -> Result<()>[src]

Set the weight of the control group’s tasks.

pub fn set_weight_for_device(
    &self,
    major: u64,
    minor: u64,
    weight: u64
) -> Result<()>
[src]

Same as set_weight(), but settable per each block device.

Trait Implementations

impl Clone for BlkIoController[src]

impl Debug for BlkIoController[src]

impl<'a> From<&'a Subsystem> for &'a BlkIoController[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Controller for T where
    T: ControllerInternal, 
[src]

pub fn apply(&Self, &Resources) -> Result<(), Error>[src]

Apply a set of resources to the Controller, invoking its internal functions to pass the kernel the information.

pub fn create(&Self)[src]

Create this controller

pub fn set_notify_on_release(&Self, bool) -> Result<(), Error>[src]

Set notify_on_release

pub fn set_release_agent(&Self, &str) -> Result<(), Error>[src]

Set release_agent

pub fn exists(&Self) -> bool[src]

Does this controller already exist?

pub fn delete(&Self) -> Result<(), Error>[src]

Delete the controller.

pub fn add_task(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller.

pub fn add_task_by_tgid(&Self, &CgroupPid) -> Result<(), Error>[src]

Attach a task to this controller by thread group id.

pub fn tasks(&Self) -> Vec<CgroupPid, Global>[src]

Get the list of tasks that this controller has.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.