-
Notifications
You must be signed in to change notification settings - Fork 19
usability improvements #9
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha :) yes, thank you for the PR, @gdkrmr! :)
Much appreciated!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I think this is a great improvement! :) Thanks again for opening the PR, @gdkrmr. :)
Pending my last comments, I'm happy to merge this.
That should be all for now. Cool package! |
add .gitignore add @pprof interface runs server async and restarts the server automatically clear profiler cache import Profile.clear and document it implements suggestions julia 1.0 compat global escape for @pprof Updated `pprof()` docstring to describe newly added refresh() functionality don't detach process add unit tests for @pprof and subprocess
I think this is because $ deps/usr/bin/pprof -http=localhost:23432 profile.pb.gz
Main binary filename not available.
Serving web UI on http://localhost:23432 One noticeable change is that now when you run Also, annoyingly, somehow the It's confusing because if i start a simple child process like this, it does get closed when I exit: p = open(pipeline(`bash -c 'while true; do sleep 1 && echo "hi"; done'`)) # killed when we ctrl-D julia but the go subprocess is not: p = open(pipeline(`$(PProf.go_pprof) -http=localhost:23432 profile.pb.gz`)) # _NOT_ killed when we ctrl-D julia! Some googling led me to this article, but i don't think this actually has anything to do with Go (unless the binary is somehow doing something to set itself to "please don't kill me!!" or something):
🙌 Thanks! :) They look great So to summarize my remaining complaints:
The second one seems problematic enough that we probably shouldn't merge this until it's fixed. :'( I'm sorry, @gdkrmr! Thanks for your really fast and great work on this; i think this will make the package more usable. :) |
Oh, huh, apparently my understanding of unix process death was just totally wrong. Orphaned processes are reparented by default, not killed: The more you know! And what's more, it doesn't sound like there's a good way to kill them by default, which is super lame. The best solutions people have are to have your child process poll the parent process and exit when the parent exits... But this sounds nontrivial. Maybe a better approach will be to:
|
I think the best behaviour is to not open the browser.
agreed
This seems like bad practice, an unsuspecting user may end up with dozens of pprof servers running.
|
For the second problem, i just wrote this kind of dumb utility, which maybe would be sufficient for our usecase? |
That is kind of cool :-), maybe a bit overkill. |
If it somehow fails to exit (e.g. if julia crashes), the user can still provide a different port or manually kill the webserver.
Okay! I've addressed my concerns by just adding an If for some reason it doesn't work (like if julia crashes) the user can always just provide a different Thanks for the brainstorming with me, @gdkrmr! And for this nice PR :) |
|
Add notes about the new behavior to the README
Alright, thanks @gdkrmr! :) I'm merging this now! :) |
pprof()
call.@pprof ex
as an alias toProfile.clear(); @profile ex; pprof()