shirou / gopsutil

psutil for golang
Other
10.48k stars 1.58k forks source link

Issue with process.Percent Data: Erroneous Inclusion of iowait in CPU Utilization Calculation #1690

Closed TheBestLL closed 6 days ago

TheBestLL commented 1 month ago

Based on the operational logic defined in psutil, iowait should not be considered in the calculations for CPU utilization. However, it appears that process.Percent is still incorporating iowait, leading to potentially inaccurate assessments of CPU activity. This could affect performance monitoring and analysis where precise CPU usage metrics are critical. It's crucial to ensure that process.Percent reflects only the active CPU usage, excluding any idle/wait times associated with IO operations.

Could we examine the implementation to confirm if iowait is mistakenly included in the CPU usage calculation and rectify this if necessary? This adjustment would align with the intended functionality of accurately reflecting CPU usage metrics, essential for system performance evaluations. https://github.com/shirou/gopsutil/blob/master/process/process.go#L324

TheBestLL commented 1 month ago

https://github.com/shirou/gopsutil/issues/902

TheBestLL commented 3 weeks ago

https://github1s.com/giampaolo/psutil/blob/c034e6692cf736b5e87d14418a8153bb03f6cf42/psutil/__init__.py#L994

TheBestLL commented 3 weeks ago

The processing logic updates with the implementation logic of psutil

Lomanic commented 6 days ago

Fixed in #1692 it looks like