Skip to content

fix: wire --show-processes and --proc-filter through --json/--serve export backends - #47

Merged
binlecode merged 1 commit into
mainfrom
fix/export-process-attribution
Aug 8, 2026
Merged

binlecode merged 1 commit into
mainfrom
fix/export-process-attribution

Conversation

@binlecode

Copy link
Copy Markdown
Owner

What

Export modes (--json / --serve) silently dropped per-process GPU data — processes in every NDJSON record was always [], even though the TUI (t key) showed populated per-process data. --show-processes and --proc-filter were honored only by the TUI path.

Changes

  • actop/actop.py: _run_export reads show_processes/proc_filter from args, forwards to both backends. --proc-filter without --show-processes implies it.
  • actop/export.py: run_json_stream and serve_prometheus accept keyword include_processes/proc_filter, pass to Monitor. snapshot_to_prometheus emits 6 per-process labelled gauges (actop_process_cpu_percent, actop_process_cpu_time_share, actop_process_gpu_time_share, actop_process_attributed_watts, actop_process_rss_bytes, actop_process_num_threads) when processes are present.
  • Tests: Delete 8 redundant CLI default-value assertion tests. Add 2 missing functional tests (proc-filter implier via --json --proc-filter, --serve --show-processes via HTTP GET /metrics).
  • CLAUDE.md: Strengthen testing rule with litmus test and explicit prohibition against standalone default-value/shape-assertion tests.

Validation

ruff check --fix . && ruff format .  # clean
pytest -q -m "not local"             # 91 passed
pytest -q -m "local" -v              # 46 passed

On-device (M4 Max): actop --json --show-processes now emits non-empty processes with gpu_time_share rows. --serve --show-processes exposes per-process gauges at /metrics.

Patch bump to 1.6.2.

…xport backends

Export modes (--json/--serve) silently dropped per-process GPU data
(processes was always []). CLI routing now forwards both flags to
run_json_stream/serve_prometheus, which pass them to Monitor.

- actop.py: _run_export reads show_processes/proc_filter from args;
  --proc-filter without --show-processes implies it
- export.py: run_json_stream and serve_prometheus accept keyword
  include_processes/proc_filter; snapshot_to_prometheus emits 6 per-process
  labelled gauges when processes are present
- Delete 8 redundant CLI default-value assertion tests; add 2 missing
  functional tests (proc-filter implier, --serve --show-processes via HTTP)
- Strengthen testing rule in CLAUDE.md with a litmus test and explicit
  prohibition against standalone default-value assertions
- Bump to 1.6.2
@binlecode
binlecode merged commit 7154ba8 into main Aug 8, 2026
5 checks passed
@binlecode
binlecode deleted the fix/export-process-attribution branch August 8, 2026 17:37
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