When the ms/req fields exceed 1 second, drop the fractions to fit more digits.

This is unfortunately necessary with some flash based devices which can
get hundreds of seconds behind with softupdates enabled.
This commit is contained in:
Poul-Henning Kamp
2008-01-06 12:12:44 +00:00
parent ba7306546f
commit 0c5de885eb
+9
View File
@@ -269,14 +269,23 @@ main(int argc, char **argv)
printw(" %6.0f", (double)ld[0]);
printw(" %6.0f", (double)ld[1]);
printw(" %6.0f", (double)ld[2] * 1024);
if (ld[3] > 1e3)
printw(" %6.0f", (double)ld[3]);
else
printw(" %6.1f", (double)ld[3]);
printw(" %6.0f", (double)ld[4]);
printw(" %6.0f", (double)ld[5] * 1024);
if (ld[6] > 1e3)
printw(" %6.0f", (double)ld[6]);
else
printw(" %6.1f", (double)ld[6]);
if (flag_d) {
printw(" %6.0f", (double)ld[8]);
printw(" %6.0f", (double)ld[9] * 1024);
if (ld[10] > 1e3)
printw(" %6.0f", (double)ld[10]);
else
printw(" %6.1f", (double)ld[10]);
}