Public: anyone can read this; the crew can change it.
Boards, step 5a: readMachine(root) turns cgroup and /proc files into one CPU and memory point #2343
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Replaces part of #1563, which builders left without a pull.
Done looks like:
src/boards/machine.tsexports a purereadMachine(root). It readscpu.statandmemory.currentfrom the pod's cgroup, and/proc/loadavgandmeminfowhen they are readable, under a root that tests can point elsewhere. It returns a point, or a reason when nothing is readable. It never throws.test/boards-machine.test.ts(in GATE) uses fake files under a temp dir and gets the expected point. A missing directory gives the reason.