pub struct Snapshot {
pub read_syscalls: Option<u64>,
pub write_syscalls: Option<u64>,
pub bytes_through_read: Option<u64>,
pub bytes_through_write: Option<u64>,
pub bytes_from_device: Option<u64>,
pub minor_faults: Option<u64>,
pub major_faults: Option<u64>,
pub page_faults: Option<u64>,
pub pageins: Option<u64>,
pub total_syscalls: Option<u64>,
/* private fields */
}Expand description
Kernel-reported counters at one instant or across one delta.
Fields§
§read_syscalls: Option<u64>read-family syscalls, available from Linux procfs.
write_syscalls: Option<u64>write-family syscalls, available from Linux procfs.
bytes_through_read: Option<u64>Bytes read through the syscall layer, including page-cache hits (Linux).
bytes_through_write: Option<u64>Bytes written through the syscall layer (Linux).
bytes_from_device: Option<u64>Bytes actually fetched from a block device (Linux).
minor_faults: Option<u64>Minor page faults reported by Linux procfs.
major_faults: Option<u64>Major page faults reported by Linux procfs.
page_faults: Option<u64>Total page faults reported by macOS.
pageins: Option<u64>Page-ins reported by macOS.
total_syscalls: Option<u64>Total Mach and Unix syscalls reported by macOS.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn now() -> Self
pub fn now() -> Self
Read the current platform’s supported process counters.
Sampling never fails the observed operation. An unavailable kernel interface yields an empty snapshot whose renderer states that no source was available.
Sourcepub const fn is_available(&self) -> bool
pub const fn is_available(&self) -> bool
Whether at least one supported kernel source was available.
Sourcepub fn since(&self, earlier: &Self) -> Self
pub fn since(&self, earlier: &Self) -> Self
This snapshot minus an earlier one: work performed between the samples.
Sourcepub fn cache_hit_ratio(&self) -> Option<f64>
pub fn cache_hit_ratio(&self) -> Option<f64>
Share of syscall-layer read bytes served without block-device reads.