-
Notifications
You must be signed in to change notification settings - Fork 385
Improve child handling #140
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
Improve child handling #140
Conversation
...umber of children; refactor the profile file reading functions
fabianp
commented
Apr 7, 2017
Thanks for the pull request!. This looks good, but give me a couple of days to look into it as I'm currently travelling
fabianp
commented
Apr 11, 2017
Why is pandas needed? Does this change the quality of the plots? I would like to maintain dependencies to the strict minimum ...
fabianp
commented
Apr 11, 2017
(numpy is fine since its required by matplotlib anyway)
rokroskar
commented
Apr 12, 2017
Right, pandas is not strictly needed and I also hesitate making another dependency. IMO the usability of the results is improved by putting them into a DataFrame. The user can then select only the PIDs they want, they can get averages, etc. It's a simple way to allow for a bit more customization.
On the other hand, it's not really a dependency, since the only function that needs pandas is convert_mem_usage_to_df and one could add a try/except there and alert the user that pandas is needed for that function. Another option would be to just return the numpy matrix that I generate along with the mapping of x and y coordinates to times and pids, but that's not as user-friendly.
rokroskar
commented
Apr 12, 2017
oh oops, I guess I already added the try/except in my last commit...
fabianp
commented
Apr 12, 2017
via email
Hello Guys
Thanks for your contribution! I find categorizing child process is extremely helpful. However the last change were committed in 2017. Is this issue going to be closed or should have been merged? Thanks!
This pull request is an extension to #118 and #134 and tries to improve the ability to analyze child process memory consumption.
Changes/additions:
pidinstead of sequentially -- this is to ensure that we can properly track children of processes where the parent might continuously spawn many short-lived childrenconvert_mem_usage_to_dffunction which produces apandas.DataFramefrom a list returned bymemory_usagefor easier plotting and slicingmprofto monitor an existing process by providing a pidSide-effects:
read_mprofile_filefunction tomemory_profilerso that it can be used programaticallyread_mprofile_file_multiprocessfunction that reads a mprofile file and returns a list of timings identical to what you expect frommemory_usagememory_usage#139plot_filewhere plotting would fail when number of children > 6timeoutflag tomprof