Gnome-shell-system-monitor-applet: Not a number

Created on 27 Apr 2020  路  16Comments  路  Source: paradoxxxzero/gnome-shell-system-monitor-applet

Disk section shows "not a number" and filled with color. Screenshot below.

notanumber

Most helpful comment

For the disk issue, I basically undid https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/commit/3ba2f60c45eac1fce8702387884f96840e224db2

In ~/.local/share/gnome-shell/extensions/[email protected]/extension.js
Find the section

        let file = Gio.file_new_for_path('/proc/diskstats');
        file.load_contents_async(null, (source, result) => {
            let as_r = source.load_contents_finish(result);
            let lines = ByteArray.toString(as_r[1]).split('\n');

Replace the last line:

let lines = ByteArray.toString(as_r[1]).split('\n');

with

let lines = String(as_r[1]).split('\n');

Then restart GNOME, either with ALT+F2, r, or logging out and logging back in (only unloading and reloading the extension doesn't work)

This was done on Gnome Shell 3.28.4

For the Temperature issue, the exact same fix described in
https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/issues/520#issuecomment-498990185 works here too.

All 16 comments

same problem after today Update.... :(

Can confirm this after update on 27 Apr 2020.

I am on Ubuntu 18.04.

Any workaround?

Can confirm this after update on 27 Apr 2020.

I am on Ubuntu 18.04.

Any workaround?

me too ubuntu 18.04. no workaround yet...

Same here, Ubuntu 18.04. Disk rates and Temp show NaN. Also, this is what temperature source selector shows:

image

Used to show sensor name.

For the disk issue, I basically undid https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/commit/3ba2f60c45eac1fce8702387884f96840e224db2

In ~/.local/share/gnome-shell/extensions/[email protected]/extension.js
Find the section

        let file = Gio.file_new_for_path('/proc/diskstats');
        file.load_contents_async(null, (source, result) => {
            let as_r = source.load_contents_finish(result);
            let lines = ByteArray.toString(as_r[1]).split('\n');

Replace the last line:

let lines = ByteArray.toString(as_r[1]).split('\n');

with

let lines = String(as_r[1]).split('\n');

Then restart GNOME, either with ALT+F2, r, or logging out and logging back in (only unloading and reloading the extension doesn't work)

This was done on Gnome Shell 3.28.4

For the Temperature issue, the exact same fix described in
https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/issues/520#issuecomment-498990185 works here too.

For the Disk issue, I basically undid 3ba2f60

In ~/.local/share/gnome-shell/extensions/[email protected]/extension.js
Find the section

        let file = Gio.file_new_for_path('/proc/diskstats');
        file.load_contents_async(null, (source, result) => {
            let as_r = source.load_contents_finish(result);
            let lines = ByteArray.toString(as_r[1]).split('\n');

Replace the last line:

let lines = ByteArray.toString(as_r[1]).split('\n');

with

let lines = String(as_r[1]).split('\n');

For the Temperature issue, the exact same fix described in
#520 (comment) works here too.

Great! Thanks!

@techsy730 I just tested this fix, and unfortunately it does not resolve the problem for Gnome Shell 3.28.

@techsy730 I just tested this fix, and unfortunately it does not resolve the problem for Gnome Shell 3.28.

mine is 3.28.4 and the problem is solved

@techsy730 I just tested this fix, and unfortunately it does not resolve the problem for Gnome Shell 3.28.

Did you log out and log back in? (Merely disabling and re-enabling doesn't pick up the new code).
Forgot to mention that in my instructions.

@techsy730 I just tested this fix, and unfortunately it does not resolve the problem for Gnome Shell 3.28.

Did you log out and log back in? (Merely disabling and re-enabling doesn't pick up the new code).
Forgot to mention that in my instructions.

If you don't want to log out, reloading gnome (ALT+F2, r) works too.

Fixed for me, Ubuntu 18.04.4 GNOME Shell 3.28.4.
Thanks!

Fixes for Disk R/W but not for Temp and Fan....

Fixes for Disk R/W but not for Temp and Fan....

Yes, for Temp and Fan you will need to follow the instructions at
https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/issues/520#issuecomment-498990185

Becaues of the concern expressed in #601, I tried something a bit different. This works for me on Ubuntu 18.04.4 x64, gnome-shell 3.28.4. Also, with this fix, I can still lock the screen without being logged out.

Follow the instructions in https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/issues/594#issuecomment-620663485, except replace

let lines = ByteArray.toString(as_r[1]).split('\n');

with:

        let lines = [];
        try  {
            lines = as_r[1].toString().split('\n');
        } catch(e) {
            global.logError('Could not split /proc/diskstats string: ' + e);
        }

I got the idea for as_r[1].toString() from this article by Avi Zajac.

Let me know if you try this! I am happy to submit a PR if desired.

Same problem here. Disk activity shown as NaN. Running GNOME Shell 3.28.4

The last mentioned fix works for me on GNOME Shell 3.28.4. Locking screen works without side-effects.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RafaelQuirino picture RafaelQuirino  路  6Comments

prhmnik picture prhmnik  路  14Comments

staticdev picture staticdev  路  5Comments

nirik picture nirik  路  7Comments

dkumor picture dkumor  路  10Comments