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
Add support for scripts that spin up processes #40
Conversation
Before was not able to accurately track aws cli streaming operations. Now this is possible.
Which streaming tasks spin off processes? I wouldn't expect that to be the case. Could you add more info? I'd prefer to just somehow track the actual process we care about rather than aggregate all child processes recursively. |
So I was doing something like this:
And that was getting me values like 2.3 MB memory usage and 0% CPU usage which is not correct at all. Is there a better way to measure this than looking at all of the child processes? I am not sure if it is easy to determine what process that we actually care about when the script is relatively general. |
Cat's unnecessary. You can use Does that work for you? |
No unfortunately. I switched it to:
and I was getting no readings for memory usage or disk usage. Only, the changes in this PR allow me to get the values. |
I think that's just because of the
I'd suggest:
|
I can do that then. |
I updated it to look to see if there is any child processes and use the first python labeled process found. If there is no child processes, then it uses the original process passed in. The streaming and nonstreaming case work with this. |
# We want to always be measuring the python process. | ||
children = process.children(recursive=True) | ||
for child_process in children: | ||
if 'python' in child_process.name(): |
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.
This should be a case insensitive search. If you look at my process tree in my original comment I have:
72364 jamesls /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python /usr/local/bin/aws s3 cp - s3://bucket
Alright. I updated to normalize to lowercase. Let me know what you think. |
Thanks. |
Before was not able to accurately track aws cli streaming operations relative to memory usage and cpu usage because the streaming tasks spin off processes in piping inputs and outputs. Now with this PR it is possible to track these numbers.
cc @jamesls @JordonPhillips