Repository navigation
Closed
Labels
Description
Summary
Record a performance track alongside the video: CPU, memory, GPU and (where available) frame timing for the target app, sampled once or twice a second into a sidecar. Add a perf_overlay step that draws a small live graph on the video, and a bug-report summary ("CPU pinned at 98% from 0:12 to 0:31, RSS +1.2 GB").
Where
src/tools/startRecording.ts: window targets (window:exe=<app.exe>,window:hwnd=<n>) already resolve to a specific window (src/utils/resolveTarget.ts), from which the owning process to sample can be found.src/utils/bugReport.ts: environment section has static machine info only, no runtime behaviour.- Nothing in
src/samples process counters today.
Details
"It freezes when I click Export" is the most common bug that a video alone can't explain. A synced resource track shows whether it was CPU-bound, leaking memory or waiting on disk, and the overlay makes that obvious in a shared clip.
Sidecar <recording>.perf.jsonl:
{ "t": 12.0, "pid": 4312, "cpu": 97.5, "rssMB": 1840, "gpu": 12.0 }Suggested fix
start_recording { perf: true | { intervalMs } }: sample the target process tree (and the whole system forfull/monitor:) via a single long-lived PowerShell/typeperfhelper, not one spawn per sample.- Write the sidecar on the video clock like the event log.
perf_overlaytool and pipeline op: render a sparkline (CPU/RAM) in a corner using the existing drawing helpers (src/utils/callout.ts/anim.ts).bug_report: add a "Resource usage" section with peaks and spans above thresholds.index_recording: index spikes as text ("cpu spike 97%") sosearch_recordingcan find them.
Acceptance criteria
- One sampler process per recording, stopped and cleaned up on every stop path
- Sidecar aligned to the video clock
- Overlay renders at any output size and survives trim/speed in
pipeline -
bug_reportsummarises peaks - Helper is covered by the orphan-reaping logic
Getting started
- Relevant files:
src/tools/startRecording.ts,src/utils/resolveTarget.ts,src/utils/bugReport.ts,src/utils/pipeline.ts - Tests:
npm test
Related: #272
Filed by repo-audit/feature-ideas at 19569f7. Severity: medium. Effort: L. audit-key: enhancement|src/tools/startRecording.ts|perf
Activity
feat(recording): a CPU and memory track beside the video (#335)
TMHSDigital commentedon Nov 16, 2026
Partly done in 38a38ea: start_recording perf: true writes .perf.jsonl on the video clock (machine CPU and memory, plus the window target's process CPU and working set), the session gets a peak summary, bug_report has a Resource usage section for the clip, and delete_recording removes the sidecar. Verified with unit tests and a live window recording (no PowerShell helper left after stop). Still open: the perf_overlay graph (and a pipeline op for it), and indexing spikes for search_recording.