Skip to content

fix(profiling): render single-sample continuous profile chunks#116234

Merged
nsdeschenes merged 1 commit into
masterfrom
fix/continuous-profile-single-sample
May 27, 2026
Merged

fix(profiling): render single-sample continuous profile chunks#116234
nsdeschenes merged 1 commit into
masterfrom
fix/continuous-profile-single-sample

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg commented May 26, 2026

Continuous profile chunks with a single sample give weight 0 to that sample (it diffs against itself). That causes appendSample to discard it and show "This flamegraph has no data." This adds a 10ms default instead to match matching the 100Hz sampling rate so the stack is still visible.

This also fixes getMaxConfigSpace to use each profile's end position (startedAt + duration) instead of just duration. Without this, a profile that starts late in the observability window renders its frames mostly off-screen, appearing blank even after the weight fix.

Put together, this fixes rendering for the two main views reported in PRO-43.

Before After
image image

Closes PRO-43.

Single-sample chunks have every sample diff against itself, giving
weight=0, which appendSample discards — leaving 0 samples and showing
"This flamegraph has no data." Assign a 10ms default weight (100Hz) so
the stack is still visible.

Also fix getMaxConfigSpace to use each profile's end position
(startedAt offset + duration) rather than just duration, so a profile
that starts late in the observability window isn't clipped off-screen.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 26, 2026

PRO-43

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.58%

@JoshuaKGoldberg
Copy link
Copy Markdown
Member Author

@cursor review

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4bbd5d9. Configure here.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review May 26, 2026 21:03
@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team as a code owner May 26, 2026 21:03
@nsdeschenes nsdeschenes merged commit efdc185 into master May 27, 2026
75 checks passed
@nsdeschenes nsdeschenes deleted the fix/continuous-profile-single-sample branch May 27, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants