Expand description
Process-level resource reads (ADR-103 Stage 1).
Cumulative CPU time and peak RSS via getrusage(2), plus current RSS
from platform APIs, used by the daemon’s phase-span logging (background-task start/completion/cancellation) and
the comm.health resource self-report. libc is already a workspace
dependency (used elsewhere in this crate for flock/kill), so this
reuses it rather than adding a new one, per ADR-103 Stage 1’s preference
for a small std/libc-based read over a dedicated sysinfo-style crate.
Structs§
- Process
Resource Usage - A point-in-time snapshot of this process’s cumulative resource usage.
Functions§
- cpu_
delta_ us - CPU time consumed strictly between two
ProcessResourceUsagesnapshots, in microseconds. - current_
rss_ bytes - Current resident bytes for this process, or None if the platform cannot supply the reading. This independent read is not on the CPU snapshot path.
- process_
resource_ usage - Read cumulative CPU and peak RSS with one getrusage call. Returns None when getrusage is unavailable or fails.