Skip to content

Commit 2af7327

Browse files
committed
worker: check for CPU idle instead of user
1 parent ba8711f commit 2af7327

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agents/src/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const cpuLoad = (): number =>
2929
(os
3030
.cpus()
3131
.reduce(
32-
(acc, x) => acc + x.times.user / Object.values(x.times).reduce((acc, x) => acc + x, 0),
32+
(acc, x) => acc + x.times.idle / Object.values(x.times).reduce((acc, x) => acc + x, 0),
3333
0,
3434
) /
3535
os.cpus().length) *

0 commit comments

Comments
 (0)