Files
RedBear-OS/local
vasilito bdec5061ef redbear-power: v1.32 CPU% and RSS per-PID history (3 sparklines)
Generalizes the v1.31 io_history pattern to two more metrics:
cpu_history and rss_history. Each Process tab row now shows
three sparklines:
  IO-RATE  (12 samples, full 78s of IO rate history)
  CPU%    (6 samples, last 39s of CPU usage)
  RSS     (6 samples, last 39s of memory)

The two new sparklines are 6 chars wide (vs 12 for IO-RATE) to
keep the panel within a 120-col terminal.

Implementation:
- Two new BTreeMap<u32, VecDeque<u64>> fields on App
- update_io_history() now updates all three maps in a single
  3-pass sweep (reap, append, normalize) for all metrics
- Extracted private helpers push_sample() and normalize_history()
  for the per-metric work; both operate on the map type
  generically
- New render::sparkline_short() helper: renders the last
  'width' samples of a history, padding with leading spaces
  for short histories

Test count 121 -> 123 (+2):
- update_io_history_populates_cpu_and_rss_for_each_pid
  (every PID gets cpu/rss entries, not just PIDs with non-zero
  values)
- update_io_history_reaps_all_three_maps (phantom-PID reap
  spans all three maps)

Redox stripped binary: 4,213,608 bytes (+12 KiB from v1.31).
Compile warnings: 55 (unchanged).
2026-06-21 07:23:27 +03:00
..