Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include percentages of parent in the report #132

Open
asmeurer opened this issue Jun 9, 2021 · 2 comments
Open

Include percentages of parent in the report #132

asmeurer opened this issue Jun 9, 2021 · 2 comments

Comments

@asmeurer
Copy link
Contributor

asmeurer commented Jun 9, 2021

It would be useful if the report showed the percentage of the time spent relative to the other frames with the same parent in addition to the absolute time.

I looked at the code, and the frame objects do not seem to reference their parents, only their children, so this isn't so easy to add as a simple method on the frame object without introducing the circular reference (not sure if that's OK to do).

@joerick
Copy link
Owner

joerick commented Jun 16, 2021

Hi @asmeurer ! I'm not sure how we'd incorporate visually into the output, but it should be easy enough to write a renderer to do it - the Frame objects do reference their parent and there's already a property : https://github.com/joerick/pyinstrument/blob/master/pyinstrument/frame.py#L21 that gives a number between 0 and 1 indicating the fraction of parent time.

@joerick
Copy link
Owner

joerick commented Nov 5, 2022

Percentage time was added in v4.3.0, although this is relative to the total, not the parent.

@joerick joerick changed the title Include percentages in the report Include percentages of parent in the report Nov 5, 2022
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

No branches or pull requests

2 participants