-
Notifications
You must be signed in to change notification settings - Fork 55
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
CPU usage is always 0 #76
Comments
windows server 2016 x64 standard with GUI |
Can you try to execute:
|
The result is: I use win32 exe which I compiled to get child process cpu usage, but it seems that child_process exec function return wrong pid.If I exec the win32 exe in CMD, it return the right result. Here is the win32 exe code: |
The result looks correct to me, maybe try to call the usage a couple of times, the measure should settle with time. |
I call the cpuUsage every 10 secs, it always return 0.but the wmic exec result is right.So maybe the problem is child_process exec func return wrong pid? |
You could debug the where clause here. I don't have access to a windows machine (especially no 2016 server edition), therefore I'm not sure how I could be able to help you... |
I'm also experiencing this issue. It used to work, or at least for some of the PIDs, but it suddenly stopped working for all of them. Currently trying get it back to semi-working again to see if I can find a repro case. EDIT: My solution was to check for cpu == 0 and retry until it showed correctly. It seems to happen every time at the beginning after the processes are first started. |
My OS is ubuntu, the cpu usage still be 0 after a long time. ctime is very small, which is less than 1 ms. |
The text was updated successfully, but these errors were encountered: