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

Comments

Projects
None yet
2 participants
@christianglodt

christianglodt commented Sep 7, 2018

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 label Sep 8, 2018

benfred added a commit that referenced this issue Sep 24, 2018

Allow Control-C to stop sampling flame graphs.
This change lets you press control-c while generating a flame graph, and
still get the flamegraph with samples taken until then.

#21
@benfred

This comment has been minimized.

Show comment
Hide comment
@benfred

benfred Sep 24, 2018

Owner

The last commit there should fix this

Owner

benfred commented Sep 24, 2018

The last commit there should fix this

@christianglodt

This comment has been minimized.

Show comment
Hide comment
@christianglodt

christianglodt Sep 24, 2018

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

christianglodt commented Sep 24, 2018

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

@benfred benfred closed this Oct 9, 2018

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