pub struct CpuMetrics {Show 16 fields
pub utilization_pct: f64,
pub per_core_pct: Vec<f64>,
pub utime_secs: f64,
pub stime_secs: f64,
pub process_count: u32,
pub process_cores_used: Option<f64>,
pub process_child_count: Option<u32>,
pub process_utime_secs: Option<f64>,
pub process_stime_secs: Option<f64>,
pub process_rss_mib: Option<u64>,
pub process_disk_read_bytes: Option<u64>,
pub process_disk_write_bytes: Option<u64>,
pub process_gpu_usage: Option<f64>,
pub process_gpu_vram_mib: Option<f64>,
pub process_gpu_utilized: Option<u32>,
pub process_tree_pids: Vec<i32>,
}Expand description
CPU metrics derived from /proc/stat tick deltas.
Fields§
§utilization_pct: f64Aggregate CPU utilization expressed as fractional cores in use (0.0..N_cores). e.g. 4.6 on a 16-core host means ~4.6 vCPUs are fully utilized. Not clamped; values very slightly above N_cores are valid under kernel rounding. N_cores is available via host discovery (host_vcpus).
per_core_pct: Vec<f64>Per-core utilization indexed by logical CPU number (0.0–100.0 each).
utime_secs: f64User+nice mode CPU time consumed across all cores in this interval (seconds).
Equivalent to Δ(user+nice ticks) / ticks_per_second.
Matches Python resource-tracker’s utime column.
stime_secs: f64System mode CPU time consumed across all cores in this interval (seconds).
Equivalent to Δ(system ticks) / ticks_per_second.
Matches Python resource-tracker’s stime column.
process_count: u32Number of processes currently in a runnable state (from /proc/stat
procs_running). Matches Python resource-tracker’s processes column.
process_cores_used: Option<f64>Fractional cores actively consumed by the tracked process tree
(root process + all descendants), derived from /proc/<pid>/stat tick
deltas divided by elapsed wall-clock ticks.
e.g. 2.0 means the tree is consuming the equivalent of 2 full cores.
None when no process PID is being tracked.
process_child_count: Option<u32>Number of live descendant processes under the tracked root PID. Does not include the root process itself. None when no process PID is being tracked.
process_utime_secs: Option<f64>User-mode CPU seconds consumed by the process tree this interval. Sum of utime tick deltas / ticks_per_second across all tree members. None when no PID is tracked.
process_stime_secs: Option<f64>System-mode CPU seconds consumed by the process tree this interval. Sum of stime tick deltas / ticks_per_second across all tree members. None when no PID is tracked.
process_rss_mib: Option<u64>Resident set size of the process tree (sum of VmRSS from /proc/pid/status) in MiB, sampled at each interval (not a delta). None when no PID is tracked.
process_disk_read_bytes: Option<u64>Disk bytes actually read from storage by the process tree this interval. Delta of /proc/pid/io read_bytes across all tree members. None when no PID is tracked or /proc/pid/io is unreadable.
process_disk_write_bytes: Option<u64>Disk bytes actually written to storage by the process tree this interval. Delta of /proc/pid/io write_bytes across all tree members. None when no PID is tracked or /proc/pid/io is unreadable.
process_gpu_usage: Option<f64>Fractional GPUs actively consumed by the tracked process tree, expressed
as the equivalent number of fully-utilized GPUs (same convention as
process_cores_used). e.g. 0.5 means the tree is using half of one GPU.
NVIDIA: derived from SM utilization via nvmlDeviceGetProcessUtilization
(no accounting mode required), summed across matched PIDs and devices,
then divided by 100.
AMD: derived from drm-engine-gfx cumulative ns via FdInfoStat delta tracking.
None when no GPU is present, NVML/AMD data is unavailable, or no samples returned.
process_gpu_vram_mib: Option<f64>Total VRAM consumed by the tracked process tree across all GPUs (MiB). NVIDIA: sum of used_gpu_memory from NVML running-process lists. AMD: sum of drm-memory-vram from /proc/pid/fdinfo for matched devices. None when no PID is tracked or no GPU is present on the host.
process_gpu_utilized: Option<u32>Number of GPUs on which at least one process in the tracked tree has allocated VRAM or appears in the running-process list. None when no PID is tracked or no GPU is present on the host.
process_tree_pids: Vec<i32>PIDs in the tracked process tree (root + all descendants). Populated by CpuCollector; used by main.rs to query per-process GPU stats. Skipped in JSON/CSV output – internal routing field only.
Trait Implementations§
Source§impl Clone for CpuMetrics
impl Clone for CpuMetrics
Source§fn clone(&self) -> CpuMetrics
fn clone(&self) -> CpuMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more