-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[issue-1357] fix by calling NtQuerySystemInformation #1358
base: master
Are you sure you want to change the base?
Conversation
related to #1357 Thank you for your contribution. However, the psutil uses "Processor Queue Length", and it works, gopsutil does has some issue. So I want to fix that instead of use other Win API. And please do not add new package. We want to keep API and gopsutil aim to be multi-platform. |
Removed the new package, Processor Queue Length call returns 0 on my computer |
Types and functions from procstats package are moved to internal/common package
Use the same logic as in Linux[^1] but with `NtQuerySystemInformation` Windows API call.[^2] [^1]: https://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html [^2]: see shirou#1358
I use
NtQuerySystemInformation
instead ofProcessorQueueLengthCounter
because the latter returns zero all time.Additionally, I'm exposing
procstats
package so developers can walk through processes and threads getting their status and other data.Additional methods/functions can be added.
Tested with this program: