Skip to content

Commit

Permalink
Correct loadavg constants for 5 and 15 minutes. Fixes giampaolo#1552
Browse files Browse the repository at this point in the history
  • Loading branch information
ammaraskar committed Sep 15, 2019
1 parent 5206cff commit 6cbe3b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psutil/arch/windows/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
// This formula comes from linux's include/linux/sched/loadavg.h
// https://github.com/torvalds/linux/blob/345671ea0f9258f410eb057b9ced9cefbbe5dc78/include/linux/sched/loadavg.h#L20-L23
#define LOADAVG_FACTOR_1F 0.9200444146293232478931553241
#define LOADAVG_FACTOR_5F 0.6592406302004437462547604110
#define LOADAVG_FACTOR_15F 0.2865047968601901003248854266
#define LOADAVG_FACTOR_5F 0.9834714538216174894737477501
#define LOADAVG_FACTOR_15F 0.9944598480048967508795473394
// The time interval in seconds between taking load counts, same as Linux
#define SAMPLING_INTERVAL 5

Expand Down Expand Up @@ -112,4 +112,4 @@ psutil_init_loadavg_counter(PyObject *self, PyObject *args) {
PyObject *
psutil_get_loadavg(PyObject *self, PyObject *args) {
return Py_BuildValue("(ddd)", load_avg_1m, load_avg_5m, load_avg_15m);
}
}

0 comments on commit 6cbe3b3

Please sign in to comment.