-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Ensure psutil for the process is accurate #937
Ensure psutil for the process is accurate #937
Conversation
For example, using https://github.com/Quansight/jupyterlab-kernel-usage returns the correct value. (see issue Quansight/jupyterlab-kernel-usage#11), e.g. CPU 99.9 |
I have used that block code and the CPU does not return the correct value. ...or should I also remove https://github.com/ipython/ipykernel/pull/937/files#diff-874f94d86eaa767fb34865311dd8fd8c0d9a2fa6c49bc21f28690058f3dfa83cR961 as you said ? (I am not sure to get the correct link, it points to just one line). |
This works for me:
Output:
Basically, if we are going to prune on every run, I think we should prune + keep the list up to date to limit the number of times we need to iterate these datastructures. |
@mlucool I have retested and now it work as expected on my env. Thx for the suggestion and better implementation. I have committed those changes. Anything else before asking a review? |
Docs failure is unrelated, but the pre-commit ones are. |
I have fixed 2 format issues and added a type to the new
|
Yeah you need to use |
ab441b7
to
361bd90
Compare
@blink1073 CI is now green. |
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.
Thanks!
I'll cut a new release early next week. |
Super! |
Fixes #912
This add to the control_thread a map of processes to allow the requesting the cpu_usage in a way psutil excepts (the cpu is only correct if is requested on the same process object).