EnterpriseDB / system_stats

A Postgres extension for exposing system metrics such as CPU, memory and disk information
Other
111 stars 24 forks source link

All load information is misunderstood and incorrectly set. #23

Open xianglin1998 opened 9 months ago

xianglin1998 commented 9 months ago

Most of the system's load information statistics only have a time range of 1-5-15, and our repo mistakenly gave a very strange time range of 10 minutes.

The value given to 10 minutes on the Windows platform points to a variable that has not undergone any updates at all. Now load is fixed of 0 on windows, for 10 minute value. https://github.com/EnterpriseDB/system_stats/blob/84f50fd8b6282369fd853a9cf2feedc01dbd2847/windows/load_avg.c#L125C69-L125C69

PSutil's code repository has the same implementation, but their scope is only 1-5-15 https://github.com/giampaolo/psutil/blob/e9dabbbcae38a52a725722c6e3df0dc94c6051ab/psutil/arch/windows/wmi.c#L118

xianglin1998 commented 9 months ago

The Linux and Darwin platforms should have been set to 15 minutes, but now they both have a 10 minute load time.

xianglin1998 commented 9 months ago

image

xianglin1998 commented 9 months ago

According to the answer to from stackoverflow related question, the load information read by/proc/loadavg under Linux is 1-5-15, which is the correct interpretation.

https://stackoverflow.com/questions/11987495/what-do-the-numbers-in-proc-loadavg-mean-on-linux