Sys.Linux.Proc.Stat (Hyper v0.1.0)

Copy Markdown View Source

Reads kernel counters from /proc/stat.

Captures the aggregate cpu line, the per-core cpuN lines, and the scalar counters (ctxt, btime, processes, procs_running, procs_blocked). The intr and softirq lines are intentionally skipped: their bodies are long, hardware-specific per-source vectors that carry no portable meaning.

CPU figures are cumulative jiffies since boot, so a single read is meaningless on its own; utilization is a busy fraction the caller derives from the delta between two snapshots (see Sys.Mon.Cpu).

Summary

Functions

Parse a /proc/stat payload.

Read and parse /proc/stat.

Functions

parse(content)

Parse a /proc/stat payload.

read()

@spec read() :: {:ok, Sys.Linux.Proc.Stat.Snapshot.t()} | {:error, File.posix()}

Read and parse /proc/stat.