Skip to content

feat: Add peak RAM usage line & remove summary#2

Merged
samuelburnham merged 4 commits into
mainfrom
peak-rss-bytes
Jun 19, 2026
Merged

feat: Add peak RAM usage line & remove summary#2
samuelburnham merged 4 commits into
mainfrom
peak-rss-bytes

Conversation

@samuelburnham

Copy link
Copy Markdown
Member

Adds a peak RAM usage line for debugging and CI benchmarks. Also, the streaming RAM output is concise and has the delta and peak RSS per span, so we don't need the final RAM summary which was overly verbose. The track_ram option now needs streaming otherwise it's a no-op

Alongside each span's human streaming line, emit `[texray] <name>
peak-rss-bytes=<N>` (raw bytes) when RAM tracking and streaming are both on.
Lets programmatic consumers read peak RSS as a single integer instead of
parsing the human-formatted `peak <X> MiB/GiB` suffix or the summary graph.
None is emitted when no RSS was sampled (non-Linux / RAM tracking off).
Remove the `RAM:` block rendered below the timeline when the examined root
span exits (`render_ram`) and its tests. RSS is still sampled when track_ram
is on and surfaced per span by the streaming close lines (human `peak` plus
the machine-readable `peak-rss-bytes=<N>` companion), so memory is visible
during the run without a trailing summary block. Docs updated to match.
Gate RSS sampling on `track_ram && streaming` (via a `sample_rss()` helper)
rather than `track_ram` alone, at all three sample sites (span enter, exit,
examined-root populate). The streaming close lines are the only consumer of
the samples, so with streaming off `track_ram` would pay for per-span
`/proc/self/status` reads that nothing renders. Documented on `track_ram()`.
@samuelburnham
samuelburnham merged commit 31d194d into main Jun 19, 2026
4 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.

2 participants