Menu

#24 Parameter to make values of some metrics stick to a certain "unit" (e.g. KB/MB)?

v1.0 (example)
closed
nobody
None
5
2024-04-24
2023-06-28
Stefano
No

Hi

An improvement/feature request.

If I didn't overlook some existing parameter, the units of some metrics that are shown on the screen (referring to the "interactive"-mode) keep switching between KB/MB/whatever depending on the current load.

In my specific case, when using a low refresh interval (1 second), I always have problems when looking at the "disk"-metric (key "d" to display it) to understand if e.g. the value "1900.6" of a certain disk were KB or MB (even with just single NVMEs values are crazy nowadays):
when I see e.g. "1900.6" for the disk nvme3n1, until my eyes find the header that would display either "WriteKB" or "WriteMB", the value is gone and I don't know if the device just handled a big spike or just some measly KBs.

Therefore, would it please be possible to implement an option that makes the "unit" stick to a specific unit (e.g. KB/MB/...) in at least some of the screens?

I personally care only about the disks-screens (primarily "d", secondarily "D" in interactive mode but in the case of "D" it's not as important as the the unit is displayed on each line), not sure about other screens/metrics.

I didn't think too deeply about this - I guess that the most obvious issue that this change would cause would be that a large value (e.g. 1900000 KB if the user would choose to display all values by using the "KB" unit) might not fit the column of the "d"-screen => maybe in such cases the screen could display the value with a suffixed character like "T"(housand), "M"(illion), "B"(illion), (don't know about bigger values :) )?

Thanks for reading this.
1)
Please try to feel a bit honored as I opened here the account just for this.
2)
Thaaanks a lot for this program!!!
I started using it many many years ago when I was a teenager (probably end of 90' / beginning of 2000'), while trying to understand why our app running on AIX had performance problems, then I saw the many "WWWWWW..." in your CPU chart while stuff was being written to disk by our Oracle DB, and that turned out to be one of the important symptoms/hints of the problem that we had (with the DB storage) => I kept using "nmon" together with "htop" since then on my own Linux PCs and servers.
Again: I'm really really grateful for this program, thanks a lot for having created it, made it work for linux and for maintaining it!!! :)

Cheers,
Stefano from Switzerland

Discussion

  • Nigel Griffiths

    Nigel Griffiths - 2023-06-29

    Hi Stefano,
    Can we clarify this request a little!
    Is this for the nmon for AIX or the nmon for Linux?
    I am guessing only Linux as you call the disk "nvme3n1".

    Simplest flag would be to stop reporting disk stats in KB
    So the smallest units become MB.
    What Linux Distro. Distro version and HW (Intel/Power) are you using?
    Cheer, Nigel

     
  • Stefano

    Stefano - 2023-06-29

    Hi Nigel
    You're right, it's for Linux.
    I personally use mainly "Gentoo Linux" (secondary distros are Debian, Mint, Arch - in the company I'm working for we use Red Hat), on AMD64 (using both Intel & AMD CPUs).

     

    Last edit: Stefano 2023-06-29
  • Nigel Griffiths

    Nigel Griffiths - 2024-04-21
    • status: open --> closed
     
  • Nigel Griffiths

    Nigel Griffiths - 2024-04-21

    Feature added and can be found in nmon version 16p.

     
  • Stefano

    Stefano - 2024-04-24

    Thanks a lot!!!!! It seems to work :)
    (I did just an initial test, I'll start using it actively once my Gentoo Linux distro makes the new 16p version available)
    Some remarks (nothing important, just FYI):
    1) Compiling
    1a) Variable "HW" of your "makefile":
    The line "HW=$(shell uname -p | sed 's/ppc64le/POWER/' | sed 's/x86_64/X86/')" returns the following on my notebook (and similar stuff on my servers):

    $ uname -p | sed 's/ppc64le/POWER/' | sed 's/x86_64/X86/'
    AMD Ryzen 5 5600H with Radeon Graphics
    

    Therefore when running "make" I get the following:

    $ make
    cc lmon.c -o nmon_AMD Ryzen 5 5600H with Radeon Graphics_Gentoo2_16q -g -O3 -Wall -lm -lncurses -D AMD Ryzen 5 5600H with Radeon Graphics -D Gentoo2
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find Ryzen: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find 5: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find 5600H: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find with: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find Radeon: No such file or directory
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find Graphics_Gentoo2_16q: No such file or directory
    collect2: error: ld returned 1 exit status
    make: *** [makefile:18: nmon] Error 1
    

    I then replaced that line with:
    HW="whatever"

    1b) ncurses lib
    Trying to run "make" after having done the above change resulted in the following:

    $ make
    cc lmon.c -o nmon_"whatever"_Gentoo2_16q -g -O3 -Wall -lm -lncurses -D "whatever" -D Gentoo2
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccH27yd3.o: undefined reference to symbol 'LINES'
    /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    make: *** [makefile:18: nmon] Error 1
    

    Not sure if that happens to people on other Linux distros (nor why exactly that happens as you do have "LDFLAGS=-lncurses", anyway in my case that was fixed that by adding this "LDFLAGS"-line:

    ...
    OSVERSION=$(shell grep ^VERSION_ID /etc/os-release | tr '"' '.' | cut --delimiter=. --fields=2 )
    
    LDFLAGS += `pkg-config --libs ncurses`
    
    nmon:
       cc $(FILE) -o nmon_...
    ...
    

    Fyi in my case running "pkg-config --libs ncurses" returns the following:

    $ pkg-config --libs ncurses
    -lncurses -ltinfo
    

    2) The caret character ("^")
    That's for me a special char which I do have in my swiss keyboard layout but I never use(d).
    Not sure how that's handled in general, anyway in my case pressing it once just puts it into some kind of intermediate local buffer (not sure how to describe that) which doesn't get yet "submitted" to the application.
    If I really want to have "^" submitted to nmon, then after having pressed it I have to press some additional key (e.g. either again "^" or "^"+[space], etc...).

    Cheers :)
    Stefano

     
  • Stefano

    Stefano - 2024-04-24

    Addendum
    Concerning 1a, additional examples:

    $ uname -p | sed 's/ppc64le/POWER/' | sed 's/x86_64/X86/'
    Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
    $ uname -p | sed 's/ppc64le/POWER/' | sed 's/x86_64/X86/'
    AMD Ryzen 5 3600 6-Core Processor
    $ uname -p | sed 's/ppc64le/POWER/' | sed 's/x86_64/X86/'
    Intel(R) Xeon(R) CPU E3-1260L v5 @ 2.90GHz
    
     

Log in to post a comment.