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

ProfilingPanel info not collected #1208

Closed
jheld opened this issue Nov 13, 2019 · 10 comments · Fixed by #1299
Closed

ProfilingPanel info not collected #1208

jheld opened this issue Nov 13, 2019 · 10 comments · Fixed by #1299

Comments

@jheld
Copy link

jheld commented Nov 13, 2019

In my usage the ProfilingPanel info is not being collected/processed, despite being enabled.

I have run in debug mode and the piece that looks most suspicious (in generate_stats) is that:

root_func = self.stats.get_root_func()

is returning a falsey root_func.

python3.6, django 2.2.6, and django debug toolbar 2.0

@tim-schilling
Copy link
Member

Do you have anything installed that might be impacting pstats.Stats?

@jheld
Copy link
Author

jheld commented Dec 9, 2019

I'll check, but can you provide more information about what to look for?

@tim-schilling
Copy link
Member

Any other debugging packages installed or any debugging monkey patching that you've done. Perhaps try seeing if you can spin up a new project (or use DDT's example project after pulling it) to see if you can use the ProfilingPanel there.

@jheld
Copy link
Author

jheld commented Dec 9, 2019

For the former, we did (in some cases) have request_profiler in the stack. But I've removed it for the test. Still not working.

Not sure about any monkey patching going on.

@tim-schilling
Copy link
Member

Are you able to use the pstats.Stats class?

@jheld
Copy link
Author

jheld commented Dec 9, 2019

Good news is that the example does work.

@jheld
Copy link
Author

jheld commented Dec 9, 2019

@tim-schilling where might I try using that stats class? python shell or somewhere else? Do you have a snippet I could run?

@tim-schilling
Copy link
Member

Run the shell with your django application so the stack should be similar. Though obviously it won't eliminate everything from your stack because running the application is still different than the shell.

This script from the docs should generate a stats class internally.

import cProfile
with cProfile.Profile() as pr:
    # ... do something ...
pr.print_stats()

@jheld
Copy link
Author

jheld commented Dec 9, 2019

I was able to run that (using .enable and disable because the context manager didn't work).

@tim-schilling
Copy link
Member

Sorry, I don't have an answer for you. I can't reproduce this problem.

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 a pull request may close this issue.

2 participants