pub struct IoSampler { /* private fields */ }Expand description
Measures disk activity between samples. Owned by the caller. sample
never blocks and allocates nothing.
use std::time::Duration;
let mut disks = sys_lib::disk::IoSampler::new()?;
std::thread::sleep(Duration::from_secs(5));
let io = disks.sample()?;
println!("read {} write {}", io.read, io.write);
for d in disks.sample_per_disk()? {
println!(" {}: busy {:?}", d.device, d.io.busy);
}Implementations§
Source§impl IoSampler
impl IoSampler
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoSampler
impl RefUnwindSafe for IoSampler
impl Send for IoSampler
impl Sync for IoSampler
impl Unpin for IoSampler
impl UnsafeUnpin for IoSampler
impl UnwindSafe for IoSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more