Skip to content

I/O stats, history recording with Top Consumers view, find open file (#11, #9, #7)#41

Merged
rezdm merged 3 commits into
mainfrom
feature/io-history-findhandle
Jun 11, 2026
Merged

I/O stats, history recording with Top Consumers view, find open file (#11, #9, #7)#41
rezdm merged 3 commits into
mainfrom
feature/io-history-findhandle

Conversation

@rezdm

@rezdm rezdm commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Implements three features in both the GUI (pex) and TUI (pexc):

Issue #11 — I/O statistics

  • ProcessInfo carries cumulative io_read_bytes/io_write_bytes (Linux: /proc/<pid>/io); DataStore computes bytes/sec rates with the same PID-reuse guards as CPU deltas
  • GUI: sortable Read/s / Write/s columns in tree and list views
  • TUI: same columns in the scrollable process list
  • FreeBSD/Solaris counters are a follow-up (columns show - there) — suggest keeping Add I/O stats #11 open retitled for that remainder, or closing it

Issue #9 — history (the original project idea)

  • New HistoryStore core service: ring buffer (600 ticks ≈ 10 min at 1 s refresh) of system aggregates + per-process samples (CPU user/kernel split, memory, I/O rates), recorded from the collection thread
  • Process popup charts are backfilled from history on open and now hold the full recorded depth — the past is visible immediately
  • View → History – Top Consumers: rank top 25 processes by average CPU/Memory/IO over 1 min / 5 min / all recorded, with trend sparklines, avg/peak, presence %, click-to-jump; exited processes stay visible (dimmed)
  • CSV export: GUI File → Export History to CSV, TUI d key → ~/pex-history-<ts>-{system,processes}.csv

Issue #7 — find open file/handle

  • GUI: Ctrl+Shift+F dialog; TUI: o key + results overlay
  • Background worker scans every process's fds and mapped libraries for a case-insensitive path substring (dedicated provider instance, joined on shutdown); results jump to the owning process

Verification

  • Clean Release builds, zero warnings (-Wall -Wextra -Wpedantic)
  • Scripted pty tests for the TUI (history CSV contents verified, find scan completes, clean quit); GUI memory parity with main (158 vs 157 MB RSS)
  • Multi-platform CI green on all four platforms for every commit on this branch

Closes #7
Closes #9

🤖 Generated with Claude Code

rezdm and others added 3 commits June 10, 2026 22:54
…, #9, #7)

Issue #11 - I/O statistics:
- ProcessInfo carries cumulative io_read_bytes/io_write_bytes (Linux:
  /proc/<pid>/io read_bytes/write_bytes; 0 = unavailable on other platforms)
- DataStore computes io_read_rate/io_write_rate (bytes/sec) with the same
  PID-reuse guards as CPU deltas
- GUI tree and list views gain sortable Read/s and Write/s columns

Issue #9 - history (the project's original goal):
- New HistoryStore core service: ring buffer (default 600 ticks) of system
  aggregates + compact per-process samples (cpu user/kernel split, memory,
  I/O rates), recorded from the collection thread
- ProcessInfo gains cpu_user_percent/cpu_kernel_percent (DataStore computes)
- Process popup charts are backfilled from history on open - the past is
  visible immediately instead of starting empty
- File > Export History to CSV writes ~/pex-history-<ts>-{system,processes}.csv

Issue #7 - find open file/handle (Process Explorer's "Find Handle"):
- Find > Find Open File / Handle (Ctrl+Shift+F): background scan of every
  process's file descriptors and mapped libraries for a case-insensitive
  path substring; results table jumps to the owning process on click
- Worker uses a dedicated provider instance (no sharing with the UI thread)
  and is joined before GLFW teardown

TUI: unchanged in this pass (I/O columns and history wiring are GUI-only
for now; pexc builds and runs unchanged).

Verified on Debian (WSL): clean Release build, zero warnings; GUI runs at
parity with main (158 vs 157 MB RSS); pexc smoke-tested (clean quit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
, #7)

- Process list gains Read/s and Write/s columns (horizontally scrollable
  row, compact format, "-" when idle)
- 'd' dumps recorded history to ~/pex-history-<ts>-{system,processes}.csv;
  result shown as a transient status-bar message (pexc now wires a
  HistoryStore into DataStore like the GUI)
- 'o' opens a find-open-file prompt: background worker scans every
  process's fds and mapped libraries for a path substring; results in a
  scrollable overlay (j/k navigate, Enter jumps to the process and expands
  its ancestors, Esc cancels/closes); worker uses a dedicated provider
  and is joined on shutdown; progress wakes the render loop via an atomic
- Status bar hints and help overlay updated; help dialog height now adapts
  to small terminals instead of a fixed 31 rows

Verified in WSL Debian: clean build; scripted pty session exercises 'd'
(both CSVs written with correct headers/data) and 'o' (scan completes over
all processes, overlay renders, clean quit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Process popup charts now hold 600 points (the full recorded depth,
  ~10 min at 1 s refresh) instead of 60, so the backfill shows everything
  HistoryStore has
- New View > "History - Top Consumers" window: pick a metric (CPU, Memory,
  I/O read, I/O write) and a window (1 min / 5 min / all recorded) and see
  the top 25 processes ranked by average consumption over that window,
  with per-process trend sparklines, avg/peak values, presence percentage,
  and click-to-jump to the live process (exited processes shown dimmed)
- HistoryStore: new aggregate() (per-PID avg/peak over a window; averages
  divide by the window length, so a process alive half the window at 100%
  CPU averages 50% - the "who ate my CPU" semantics) and
  get_metric_series() (single-metric per-PID series for sparklines)
- Aggregation cached in the view, recomputed on parameter change or 1 s

Verified: clean Release build (zero warnings), pexc smoke test passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rezdm rezdm merged commit 3b6e92c into main Jun 11, 2026
9 checks passed
@rezdm rezdm mentioned this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant