Skip to content

feat: node dashboard CPU in cores, memory in GiB - #289

Merged
popodidi merged 1 commit into
mainfrom
axe/task-2502--work
Dec 2, 2026
Merged

popodidi merged 1 commit into
mainfrom
axe/task-2502--work

Conversation

@popodidi

@popodidi popodidi commented Dec 2, 2026

Copy link
Copy Markdown
Owner

axe task 2502 (owner msg #6747): the web Node view shows CPU and memory as absolute amounts, not percentages.

Collector (crates/axe-core/src/node_metrics.rs)

  • Sample gains cpu_cores (capacity: the tightest cgroup v2 cpu.max on the node's own cgroup path, else online host CPUs) and cpu_used_cores.
  • Under a CPU limit, cores used = the limiting cgroup's cpu.stat usage_usec per wall second, and cpu_percent is of the limit; otherwise cores used = busy share x host cores.
  • Under the tightest memory.max, mem_total_bytes is that limit and mem_used_bytes its memory.current - inactive_file.
  • New fields live in the stored sample JSON (serde(default)): no DB schema change. record bounds them (finite, capacity <= 65536, used <= capacity).

Web (web/components/dashboard/node.tsx, web/lib/node.ts)

  • CPU tile: 1.9 cores, detail of 8 · load .... CPU chart in cores (avg and peak band) with a dashed capacity N line; history (stored as percent of capacity) is drawn against the current capacity.
  • Memory tile: of 16.0 GiB, percent dropped. Disk unchanged.
  • A sample from an older node (no cpu_cores) falls back to percent.
  • docs/user/concepts/architecture.md updated.

Telegram /node is unchanged.

Tests

  • Rust: host and cgroup sampling, cgroup file parsing, record bounds.
  • Web: node.test.ts helpers; node.spec.ts checks cores, of 8, no percent, the capacity line and the cores readout.

Local: cargo fmt --check, clippy -D warnings, cargo test --locked, ts_bindings, doc links, web lint/typecheck/test/build and all 219 browser tests pass.

🤖 Generated with Claude Code

The node sample gains cpu_cores (a cgroup v2 CPU limit on the node's own
cgroup path, else the host's online CPUs) and cpu_used_cores. Under a CPU
limit cores used come from the limiting cgroup's cpu.stat and the CPU
percent is of the limit; under a memory limit memory is that cgroup's
working set of its limit. Both ride in the stored sample JSON: no schema
change.

The web Node view shows the CPU tile as cores in use of the capacity and
charts history in cores with a capacity line; the memory tile drops its
percent. A sample from an older node falls back to percent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@popodidi
popodidi merged commit a2030fc into main Dec 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant