Skip to content

gh-155591: Fix flame graph sample-time conversion in profiling.sampling - #155592

Closed
AbhinavMir wants to merge 3 commits into
python:mainfrom
AbhinavMir:flamegraph-sample-time
Closed

gh-155591: Fix flame graph sample-time conversion in profiling.sampling#155592
AbhinavMir wants to merge 3 commits into
python:mainfrom
AbhinavMir:flamegraph-sample-time

Conversation

@AbhinavMir

@AbhinavMir AbhinavMir commented Aug 11, 2026

Copy link
Copy Markdown

…sampling

The flame graph tooltips and status bar divided node values by 1000 and
labelled the result as milliseconds.  Node values are sample counts, so the
displayed times were wrong by a factor of the sampling interval (1000x at the
default 1 kHz rate).

Convert sample counts using the sampling interval instead, and always record
that interval in the exported flamegraph data.
@AbhinavMir
AbhinavMir requested a review from pablogsal as a code owner August 11, 2026 20:59
@python-cla-bot

python-cla-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Comment thread Lib/profiling/sampling/_flamegraph_assets/flamegraph.js Outdated
Comment thread Lib/profiling/sampling/_flamegraph_assets/flamegraph.js Outdated

Copy link
Copy Markdown
Member

Thanks @AbhinavMir for taking the time to prepare this fix. Since #155591 has been closed as a duplicate of #154059, and #154036 is already addressing the same problem, I’m closing this PR so the discussion and implementation can remain consolidated there. Thank you again for contributing!

@pablogsal pablogsal closed this Aug 11, 2026
@AbhinavMir

AbhinavMir commented Aug 11, 2026

Copy link
Copy Markdown
Author

All good @pablogsal - thanks for reviewing and updating! I just thought I was being quick haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants