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

wrong cup.avgLoad calculation #921

Open
qoomon opened this issue Jul 4, 2024 · 0 comments
Open

wrong cup.avgLoad calculation #921

qoomon opened this issue Jul 4, 2024 · 0 comments

Comments

@qoomon
Copy link

qoomon commented Jul 4, 2024

Describe the bug

systeminformation/lib/cpu.js

Lines 1583 to 1584 in bb006e4

let loads = os.loadavg().map(function (x) { return x / util.cores(); });
let avgLoad = parseFloat((Math.max.apply(Math, loads)).toFixed(2));

The calculation seems to be wrong, because os.loadavg() Returns an array containing the 1, 5, and 15 minute load averages. see https://nodejs.org/api/os.html#osloadavg therefore it does not make sense to divide these average load numbers by the count of cpu cores os.loadavg().map(function (x) { return x / util.cores(); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant