-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 getloadavg moving averages are incorrect #1552
Comments
@ammaraskar do you agree with the analysis? |
Aah yeah, this seems to be right. The calculations and wolfram links are provided here: #1484 (comment) were wrong due to the brackets, it should have been Sorry about that, I'll make a PR to fix it. |
ammaraskar
added a commit
to ammaraskar/psutil
that referenced
this issue
Sep 15, 2019
Thanks man. |
ammaraskar
added a commit
to ammaraskar/sysinfo
that referenced
this issue
Jul 2, 2020
There was an error in the parenthesis during the calculation of this constant, fixing this in the downstream projects where it got propagated to. See giampaolo/psutil#1552 giampaolo/psutil#1583
ammaraskar
added a commit
to ammaraskar/SWARM
that referenced
this issue
Jul 2, 2020
There was an error in the parenthesis during the calculation of this constant, fixing this in the downstream projects where it got propagated to. See giampaolo/psutil#1552 giampaolo/psutil#1583
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Platform
Bug description
Thanks for implementing getloadavg for windows in psutil/psutil/arch/windows/wmi.c
I think that there was a slipup with the factors:
#define LOADAVG_FACTOR_1F 0.9200444146293232478931553241
#define LOADAVG_FACTOR_5F 0.6592406302004437462547604110
#define LOADAVG_FACTOR_15F 0.2865047968601901003248854266
LOADAVG_FACTOR_1F is good but I think LOADAVG_FACTOR_5F and LOADAVG_FACTOR_15F should be as follows:
#define LOADAVG_FACTOR_5F 0.9834714538216174894737477501 // 1/exp(5/300)
#define LOADAVG_FACTOR_15F 0.9944598480048967508795473395 // 1/exp(5/900)
This better matches linux/sched/loadavg.h:
LOADAVG_FACTOR_1F = 1884/2048= 0.92...
LOADAVG_FACTOR_5F = 2014/2048= 0.98...
LOADAVG_FACTOR_14F = 2037/2048= 0.99...
Sorry, I would post a pr if I could.
The text was updated successfully, but these errors were encountered: