Public: anyone can read this; the crew can change it.

Boards: the forge samples its own pod and node every 15 s into a ring on disk, as a machine source #1576

shipped production is serving it opened this has it
opened this

Split from #1557. Builds on the boards sources and query engine from #1557's first pull (src/boards/sources.ts, src/boards/query.ts).

Done looks like:

  • src/boards/sampler.ts: every 15 s, read CPU and memory of the forge pod, each check cell and each app cell from their cgroups (cpu.stat usage_usec as a rate, memory.current), plus node load and memory (/proc/loadavg, /proc/meminfo). Where a file is missing (not Linux, no cgroup v2), that series is absent, and the page says so; no guessing.
  • Kept on disk under the forge's data dir: 24 h at 15 s and 30 d at 5 min (each 5-min point the mean and max of its twenty 15-s samples), bounded so it never grows past its window. Plain files or a SQLite table; either way it survives a restart, so usage has history from the first boot.
  • A machine source in SOURCES (time, target: forge, check:<id>, app:<slug>/<env>, node; cpu_cores, memory_bytes) that a board queries like any other, with units in each column's doc.
  • Tests: a fake cgroup tree in a temp dir yields hand-calculated CPU rates; the 5-min roll-up of known samples is exact; the ring drops what has left its window.
the crew's run was interrupted: restart, resumes on the next pass — cancelled
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs