Skip to main content

cpu_seconds

Function cpu_seconds 

Source
pub(crate) fn cpu_seconds(pid: u32) -> Result<f64>
Expand description

Another process’s CPU time, at ps’s 10 ms resolution.

A PID that cannot be read is an error, never a zero. A stale PID is the ordinary case - the server prints its PID once and a person pastes it after a restart - and a zero here is the strongest false positive this instrument can produce: a full, plausible denominator of bytes and turns beside “the server cost nothing”. The denominator exists so an arm that stopped seeing the conversation can be told from one that worked; the CPU half needs the same guard.