Skip to content
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

[Windows]Why are the indicators collected by glances too large? #2702

Closed
RLYRLY opened this issue Mar 21, 2024 · 1 comment
Closed

[Windows]Why are the indicators collected by glances too large? #2702

RLYRLY opened this issue Mar 21, 2024 · 1 comment
Labels
dependencies Pull requests that update a dependency file

Comments

@RLYRLY
Copy link

RLYRLY commented Mar 21, 2024

When collecting the CPU utilization of the same process within the same time range, it is found that the value collected by glances will be larger, and the task manager that comes with Windows will be much less.
After doing a benchmark test, the CPU utilization output by psutil was 55%, and the result using a PowerShell script combined with Windows Performance Counters was 6%. The difference is nearly 10 times.

After reading the latest psutil source code, the CPU utilization uses the GetSystemTimes API, but the calculation of the CPU utilization in the task manager after win10 has changed. The GetSystemTimes API has been a long time ago, and now it is replaced by a "performance counter", so there are inconsistencies.
The performance counter module under WMI obtains the process CPU utilization, which should be the same as what is displayed in the task manager.
https://learn.microsoft.com/en-us/windows/win32/perfctrs/performance-counters-portal
https://learn.microsoft.com/en-us/windows/win32/wmisdk/monitoring-performance-data

@nicolargo
Copy link
Owner

Hi @RLYRLY

It's a PSUtil issue (i saw that you also open an issue in the Psutil repository: giampaolo/psutil#2384).

So i close the Glances issue waiting for the analysis/correction on the PsUtil lib.

Thanks !

@nicolargo nicolargo added the dependencies Pull requests that update a dependency file label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants