pub struct ProcessSnapshot {
pub pid: u32,
pub name: String,
pub cpu_pct: f64,
pub rss_bytes: i64,
pub disk_read_bytes_per_sec: Option<f64>,
pub disk_written_bytes_per_sec: Option<f64>,
}Expand description
Single process row inside ProcessPerf. Mirrors the shape of
the agent’s self-perf fields on Heartbeat so existing
formatters (em-dash for nulls etc.) keep working on the SPA.
Fields§
§pid: u32PID — u32 matches Windows DWORD and is wide enough for
Linux’s 22-bit space too.
name: StringImage name as sysinfo reports it (basename on Linux, “program.exe” on Windows). NOT the full path — that lives in inventory if an operator needs to disambiguate two identically named processes.
cpu_pct: f64Percent-of-one-core, same convention as
Heartbeat::agent_cpu_pct. A worker pinning two cores reports
200.0 here; divide by the host’s core count for a host-
normalised view.
rss_bytes: i64Resident set size in bytes — sysinfo’s Process::memory().
i64 (not u64) so the projector binds cleanly via
sqlx::query! against an INTEGER column.
disk_read_bytes_per_sec: Option<f64>Disk read rate, B/s, computed agent-side by diffing successive
cumulative Process::disk_usage().total_read_bytes and
dividing by elapsed wall time. None on the very first tick
for a freshly-tracked PID (no prior sample to diff) and after
any cadence change that resets the baseline.
disk_written_bytes_per_sec: Option<f64>Trait Implementations§
Source§impl Clone for ProcessSnapshot
impl Clone for ProcessSnapshot
Source§fn clone(&self) -> ProcessSnapshot
fn clone(&self) -> ProcessSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more