Fixed: cpu frequency type change in psutil 5.8.1

pull/295/head
aristocratos 2021-04-25 02:44:52 +02:00
parent 884aeb83f5
commit 8c9972c8d3
1 changed files with 2 additions and 1 deletions

View File

@ -3044,7 +3044,8 @@ class CpuCollector(Collector):
del cls.cpu_usage[n][0]
try:
if hasattr(psutil.cpu_freq(), "current"):
cls.cpu_freq = round(psutil.cpu_freq().current)
freq: float = psutil.cpu_freq().current
cls.cpu_freq = round(freq * (1 if freq > 10 else 1000))
except Exception as e:
if not cls.freq_error:
cls.freq_error = True