s-tui icon indicating copy to clipboard operation
s-tui copied to clipboard

adjust frequency-graph max to reflect change in psutil reporting

Open sq-pyxisai opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. Looks like psutil v5.8.0 (used in s-tui v1.0.0) reported max frequency and instantaneous frequency in KHz, while psutil v5.9.0 (latest version, and installed with current implementation of s-tui) reports max frequency in KHz but instantaneous frequency in MHz. Hence, the scale of the frequency bar graph is such that frequency bars are too small to be seen.

Describe the solution you'd like Modify function in s_tui.sources.freq_source.py as follows: def get_top(self): logging.debug("Returning top %s", self.top_freq) # top frequency is in KHz, live frequency is in MHz, looks like. Need to divide top by 1000 so the # graph is scaled correctly return self.top_freq / 1000

Additional context May need some check of what version psutil is running and adjust this function accordingly...

sq-pyxisai avatar Dec 31 '21 16:12 sq-pyxisai

my units might be wrong... it may be that 5.9 reports instantaneous frequency in GHz (and max frequency in MHz).

sq-pyxisai avatar Dec 31 '21 19:12 sq-pyxisai

Hah, missed this ticket here. I reported the issue in psutil: https://github.com/giampaolo/psutil/issues/2049 It appears that https://github.com/giampaolo/psutil/pull/1852 implemented caching and might have changed the behavior by that.

grobie avatar Jan 06 '22 12:01 grobie

Nice. looks like the change made in psutil should fix it. I may try to pull that code later and see.

sq-pyxisai avatar Jan 07 '22 15:01 sq-pyxisai

Thank you for openning the issue. This seems to be a changed in the latest version of psutil. The fix is already implemented, but the package needs updating. #2049

For now you can try manually installing the latest version of psutil

amanusk avatar Jan 07 '22 19:01 amanusk

This issue, which is actually caused by 'psutil' == 5.9.0 can be solved by downgrade pstuil v5.8.0. However, I'm not very sure about the root of this problem currently.

genema avatar Mar 07 '22 12:03 genema

Installing psutil 5.9.1 solved the issue too.

ejgallego avatar Aug 24 '22 22:08 ejgallego