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

Allow collecting data for flame graph until interrupted #21

Closed
christianglodt opened this issue Sep 7, 2018 · 2 comments
Closed

Allow collecting data for flame graph until interrupted #21

christianglodt opened this issue Sep 7, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@christianglodt
Copy link

It would be useful if py-spy could be run in such a way that it would collect data for the flame graph until interrupted by a signal.

My use case would be to write a Django middleware that would attach py-spy at the start of a request, and interrupt it when the request is done, and then return the flame graph svg to the client instead of the actual content.
This would also allow to write a context manager that starts/stops py-spy during the run of a single block of code.

@benfred benfred added the enhancement New feature or request label Sep 8, 2018
benfred added a commit that referenced this issue Sep 24, 2018
This change lets you press control-c while generating a flame graph, and
still get the flamegraph with samples taken until then.

#21
@benfred
Copy link
Owner

benfred commented Sep 24, 2018

The last commit there should fix this

@christianglodt
Copy link
Author

Excellent, I'll try it as soon as I can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants