pub struct HostPerf {
pub pc_id: String,
pub at: DateTime<Utc>,
pub cpu_pct: Option<f64>,
pub cpu_count: Option<u32>,
pub mem_used_bytes: Option<i64>,
pub mem_total_bytes: Option<i64>,
pub swap_used_bytes: Option<i64>,
pub swap_total_bytes: Option<i64>,
pub disk_read_bytes_per_sec: Option<f64>,
pub disk_written_bytes_per_sec: Option<f64>,
pub net_rx_bytes_per_sec: Option<f64>,
pub net_tx_bytes_per_sec: Option<f64>,
}Fields§
§pc_id: String§at: DateTime<Utc>§cpu_pct: Option<f64>Whole-host CPU utilisation in percent (0..100), normalised
across all logical cores — the Task Manager “CPU” column
shape, NOT sysinfo’s per-core sum (which would report 800 on
an 8-core box pegged at 100 %). On Windows the underlying
signal is NtQuerySystemInformation(SystemProcessorPerformance Information); cost is sub-millisecond and scales with logical
core count, not process count.
cpu_count: Option<u32>Number of logical cores reported by sysinfo. Sent every tick so the SPA can render “8 cores” alongside the chart without needing a second API call into the inventory table.
mem_used_bytes: Option<i64>Physical memory in use, bytes. sysinfo’s System::used_memory()
— on Windows this is MEMORYSTATUSEX.ullTotalPhys - ullAvailPhys, matching Task Manager’s “In use” indicator.
mem_total_bytes: Option<i64>Physical memory total, bytes. Constant for the lifetime of a host but sent every tick so the SPA can render a ratio without a second query.
swap_used_bytes: Option<i64>Swap / pagefile used, bytes. None on systems with no
configured swap (some sandboxes / containers).
swap_total_bytes: Option<i64>§disk_read_bytes_per_sec: Option<f64>Disk read throughput across all volumes, bytes/sec. The
agent diffs sysinfo’s cumulative Disk::usage() counters
between successive ticks and divides by the elapsed wall time
— backend stores the rate verbatim. None on the first tick
after agent start (no prior sample to diff) and after any
configuration-driven cadence change that resets the baseline.
disk_written_bytes_per_sec: Option<f64>§net_rx_bytes_per_sec: Option<f64>Network receive throughput across all interfaces (including
loopback), bytes/sec. Same diff-vs-prev-sample shape as
disk_*_bytes_per_sec. We include loopback in the total
because filtering it out reliably across Win / Linux is
surprisingly fiddly and most fleet hosts don’t drive much
loopback traffic.
net_tx_bytes_per_sec: Option<f64>