From 8df10f3c7bb8f58ca225dfedc907dc04c9a7c525 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Mon, 17 Oct 2022 18:58:18 +0200 Subject: [PATCH] Fix the CPU Frequency Graph by using GHz for the upper threshold instead of Hz psutil only returns GHz for the cpu frequency, so we need to adapt the upper limit of the graph to make it useful again --- s_tui/sources/freq_source.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/s_tui/sources/freq_source.py b/s_tui/sources/freq_source.py index 5235f31..4a09171 100644 --- a/s_tui/sources/freq_source.py +++ b/s_tui/sources/freq_source.py @@ -37,7 +37,7 @@ def __init__(self): Source.__init__(self) self.name = 'Frequency' - self.measurement_unit = 'MHz' + self.measurement_unit = 'GHz' self.pallet = ('freq light', 'freq dark', 'freq light smooth', 'freq dark smooth') @@ -68,5 +68,6 @@ def get_maximum(self): return self.max_freq def get_top(self): + # Divide top frequency by 1000, as psutil only returns ghz instead of mhz (as of psutil v5.9.1) logging.debug("Returning top %s", self.top_freq) - return self.top_freq + return self.top_freq / 1000