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

Modified fixed cpu usage percentage #99

Merged
merged 3 commits into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import sys
import time
import warnings
from math import isclose
from pathlib import Path
from pprint import pformat
from subprocess import getoutput, call, run
Expand Down Expand Up @@ -303,7 +304,7 @@ def set_powersave():
if load1m > CPUS / 7:
print("High load, setting turbo boost: on")
turbo(True)
elif cpuload > 25:
elif psutil.cpu_percent(percpu=False) >= 25.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
print("High CPU load, setting turbo boost: on")
turbo(True)
else:
Expand Down Expand Up @@ -331,7 +332,7 @@ def mon_powersave():
print("Currently turbo boost is: off")
footer()

elif cpuload > 25:
elif psutil.cpu_percent(percpu=False) >= 25.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
print("High CPU load, suggesting to set turbo boost: on")
if turbo():
print("Currently turbo boost is: on")
Expand Down Expand Up @@ -364,7 +365,7 @@ def set_performance():
if load1m >= CPUS / 5:
print("High load, setting turbo boost: on")
turbo(True)
elif cpuload > 20:
elif psutil.cpu_percent(percpu=False) >= 15.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
print("High CPU load, setting turbo boost: on")
turbo(True)
else:
Expand Down