IO rates above 100 MB/s are common with SSD; this patch expands the
column so it stays neatly printed.

An argument can be made for expanding it one more for fast M.2 drives.

? dkstats.d
? iostat
? iostat.d
Index: iostat.c
===================================================================
RCS file: /cvs/src/usr.sbin/iostat/iostat.c,v
retrieving revision 1.42
diff -u -p -r1.42 iostat.c
--- iostat.c    14 Oct 2019 19:22:17 -0000      1.42
+++ iostat.c    7 Aug 2020 19:00:45 -0000
@@ -227,7 +227,7 @@ header(void)
                                if (ISSET(todo, SHOW_TOTALS))
                                        printf(" %18.18s ", cur.dk_name[i]);
                                else
-                                       printf(" %16.16s ", cur.dk_name[i]);
+                                       printf(" %17.17s ", cur.dk_name[i]);
                        }
        if (ISSET(todo, SHOW_STATS_2))
                for (i = 0; i < dk_ndrive; i++)
@@ -252,7 +252,7 @@ header(void)
                                if (ISSET(todo, SHOW_TOTALS))
                                        printf("  KB/t   xfr     MB ");
                                else
-                                       printf("  KB/t  t/s  MB/s ");
+                                       printf("  KB/t  t/s   MB/s ");
                        }
        if (ISSET(todo, SHOW_STATS_2))
                for (i = 0; i < dk_ndrive; i++)
@@ -299,10 +299,7 @@ disk_stats(double etime)
                            (double)(1024 * 1024);
                else
                        mbps = 0;
-               if (ISSET(todo, SHOW_TOTALS))
-                       printf(" %6.2f ", mbps / etime);
-               else
-                       printf(" %5.2f ", mbps / etime);
+               printf(" %6.2f ", mbps / etime);
        }
 }
 


Reply via email to