On Wed, May 09, 2018 at 06:35:52PM +0200, Alexander Bluhm wrote:
> On Wed, May 09, 2018 at 01:36:08PM +0200, Martin Pieuchot wrote:
> > > To keep it simple, systat(1) vmstat view now shows the spinning time 
> > > instead
> > > of the nice time.
> 
> Could the nice time added to user there?  I interpret this line
> that the sum should be 100%.  Anyway, that can be changed later.

We should not ignore nice time.  The sum is not 100%, a busy machine
looks idle.  As %Nic does not fit in the columns, I add it to %Usr.
Also I introduce @ for spinning time to keep the characters people
are used to.  Put %Spn between %Int and %Sys like in top.

   1.0%Int  11.0%Spn  12.0%Sys  55.0%Usr  21.0%Idle
|    |    |    |    |    |    |    |    |    |    |
|@@@@@======>>>>>>>>>>>>>>>>>>>>>>>>>>>>           

ok?

bluhm

Index: usr.bin/systat/vmstat.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.bin/systat/vmstat.c,v
retrieving revision 1.84
diff -u -p -r1.84 vmstat.c
--- usr.bin/systat/vmstat.c     14 May 2018 12:31:21 -0000      1.84
+++ usr.bin/systat/vmstat.c     19 May 2018 09:30:29 -0000
@@ -268,7 +268,7 @@ labelkre(void)
        mvprintw(GENSTATROW, GENSTATCOL, "   Csw   Trp   Sys   Int   Sof  Flt");
 
        mvprintw(GRAPHROW, GRAPHCOL,
-           "    . %%Int    . %%Sys    . %%Usr    . %%Spn    . %%Idle");
+           "    . %%Int    . %%Spn    . %%Sys    . %%Usr    . %%Idle");
        mvprintw(PROCSROW, PROCSCOL, "Proc:r  d  s  w");
        mvprintw(GRAPHROW + 1, GRAPHCOL,
            "|    |    |    |    |    |    |    |    |    |    |");
@@ -306,8 +306,8 @@ labelkre(void)
        } while (0)
 #define MAXFAIL 5
 
-static char cpuchar[] = { '|', '=', '>', '-', ' ' };
-static char cpuorder[] = { CP_INTR, CP_SYS, CP_USER, CP_SPIN, CP_IDLE };
+static char cpuchar[] = { '|', '@', '=', '>', ' ' };
+static char cpuorder[] = { CP_INTR, CP_SPIN, CP_SYS, CP_USER, CP_IDLE };
 
 void
 showkre(void)
@@ -370,6 +370,8 @@ showkre(void)
        for (c = 0; c < nitems(cpuorder); c++) {
                i = cpuorder[c];
                f1 = cputime(i);
+               if (i == CP_USER)
+                       f1 += cputime(CP_NICE);
                f2 += f1;
                l = (int) ((f2 + 1.0) / 2.0) - psiz;
                putfloat(f1, GRAPHROW, GRAPHCOL + 1 + (10 * c), 5, 1, 0);

Reply via email to