pub struct HostUsage {
pub cpu_percent: Option<f32>,
pub memory_used_bytes: u64,
pub memory_total_bytes: u64,
pub disk_bytes_per_second: Option<(u64, u64)>,
pub network_bytes_per_second: Option<(u64, u64)>,
}Expand description
The machine the flock runs on, as the shepherd last read it.
Three of the four numbers are rates, so none of them exists in a single moment: CPU, disk traffic and network traffic are all differences between two readings of a counter the kernel only ever increments. The shepherd keeps the earlier reading between its own ticks and serves the difference, which is what lets a one-shot listing carry them at all.
Answered by Response::HostUsage, and by nothing else: this is
deliberately not a field on Response::Flock, whose array shape
predates it.
Fields§
§cpu_percent: Option<f32>Every core’s usage over the shepherd’s last window, as one percentage of one whole machine.
None where no window long enough to divide by has passed yet, which
on a shepherd that has just booted it has not. Absent is not idle.
memory_used_bytes: u64Memory in use, as the platform reports it. Not a rate, so never absent.
memory_total_bytes: u64Total physical memory.
disk_bytes_per_second: Option<(u64, u64)>Bytes a second the block devices read and wrote over that window,
absent on Self::cpu_percent’s terms.
network_bytes_per_second: Option<(u64, u64)>Bytes a second the non-loopback interfaces received and transmitted over that window, absent on the same terms.