#[derive(Default, Clone, Copy)]
pub struct ProcSnapshot {
pub vm_size: u64,
pub rss: u64,
pub pss: u64,
pub shared: u64,
pub anon: u64,
pub read_bytes: u64,
pub write_bytes: u64,
}
impl std::ops::AddAssign for ProcSnapshot {
fn add_assign(&mut self, other: Self) {
self.vm_size += other.vm_size;
self.rss += other.rss;
self.pss += other.pss;
self.shared += other.shared;
self.anon += other.anon;
self.read_bytes += other.read_bytes;
self.write_bytes += other.write_bytes;
}
}
#[derive(Default, Clone, Copy)]
pub struct GlobalSnapshot {
pub mem_available: Option<u64>,
pub mem_free: u64,
pub cached: u64,
pub anon: Option<u64>,
pub swap_free: u64,
}