mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
usr.sbin/gstat: add microsecond precision for disk latency
This patch makes gstat to show latency in microseconds if actual latency is less than 1ms. It affects only "ms/r" and "ms/w" columns. Before patch: L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name 0 922 0 0 0.0 922 35809 0.0 2.8| nda0 0 928 2 34 0.1 926 35809 0.0 3.1| nda1 After patch: L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name 0 496 1 31 0.156 495 16020 0.040 1.5| nda0 0 492 0 0 0.000 492 16020 0.042 1.5| nda1 Reviewed by: imp MFC after: 3 days Sponsored by: Postgres Professional Differential Revision: https://reviews.freebsd.org/D41999
This commit is contained in:
parent
d6fb9f8ca3
commit
d471b4f71d
@ -406,16 +406,20 @@ main(int argc, char **argv)
|
||||
PRINTMSG(",%.0f", (double)ld[2] * 1024);
|
||||
if (ld[3] > 1e3)
|
||||
PRINTMSG(",%.0f", (double)ld[3]);
|
||||
else
|
||||
else if (ld[3] > 1e0)
|
||||
PRINTMSG(",%.1f", (double)ld[3]);
|
||||
else
|
||||
PRINTMSG(",%.3f", (double)ld[3]);
|
||||
PRINTMSG(",%.0f", (double)ld[4]);
|
||||
if (flag_s)
|
||||
PRINTMSG(",%.0f", (double)ld[14]);
|
||||
PRINTMSG(",%.0f", (double)ld[5] * 1024);
|
||||
if (ld[6] > 1e3)
|
||||
PRINTMSG(",%.0f", (double)ld[6]);
|
||||
else
|
||||
else if (ld[6] > 1e0)
|
||||
PRINTMSG(",%.1f", (double)ld[6]);
|
||||
else
|
||||
PRINTMSG(",%.3f", (double)ld[6]);
|
||||
|
||||
if (flag_d) {
|
||||
PRINTMSG(",%.0f", (double)ld[8]);
|
||||
@ -426,9 +430,12 @@ main(int argc, char **argv)
|
||||
if (ld[10] > 1e3)
|
||||
PRINTMSG(",%.0f",
|
||||
(double)ld[10]);
|
||||
else
|
||||
else if (ld[10] > 1e0)
|
||||
PRINTMSG(",%.1f",
|
||||
(double)ld[10]);
|
||||
else
|
||||
PRINTMSG(",%.3f",
|
||||
(double)ld[10]);
|
||||
}
|
||||
|
||||
if (flag_o) {
|
||||
@ -436,8 +443,11 @@ main(int argc, char **argv)
|
||||
if (ld[12] > 1e3)
|
||||
PRINTMSG(",%.0f",
|
||||
(double)ld[12]);
|
||||
else if (ld[12] > 1e0)
|
||||
PRINTMSG(",%.1f",
|
||||
(double)ld[12]);
|
||||
else
|
||||
PRINTMSG(",%.1f",
|
||||
PRINTMSG(",%.3f",
|
||||
(double)ld[12]);
|
||||
}
|
||||
PRINTMSG(",%.1lf", (double)ld[7]);
|
||||
@ -450,16 +460,20 @@ main(int argc, char **argv)
|
||||
PRINTMSG(" %6.0f", (double)ld[2] * 1024);
|
||||
if (ld[3] > 1e3)
|
||||
PRINTMSG(" %6.0f", (double)ld[3]);
|
||||
else
|
||||
else if (ld[3] > 1e0)
|
||||
PRINTMSG(" %6.1f", (double)ld[3]);
|
||||
else
|
||||
PRINTMSG(" %6.3f", (double)ld[3]);
|
||||
PRINTMSG(" %6.0f", (double)ld[4]);
|
||||
if (flag_s)
|
||||
PRINTMSG(" %6.0f", (double)ld[14]);
|
||||
PRINTMSG(" %6.0f", (double)ld[5] * 1024);
|
||||
if (ld[6] > 1e3)
|
||||
PRINTMSG(" %6.0f", (double)ld[6]);
|
||||
else
|
||||
else if (ld[6] > 1e0)
|
||||
PRINTMSG(" %6.1f", (double)ld[6]);
|
||||
else
|
||||
PRINTMSG(" %6.3f", (double)ld[6]);
|
||||
|
||||
if (flag_d) {
|
||||
PRINTMSG(" %6.0f", (double)ld[8]);
|
||||
@ -471,9 +485,12 @@ main(int argc, char **argv)
|
||||
if (ld[10] > 1e3)
|
||||
PRINTMSG(" %6.0f",
|
||||
(double)ld[10]);
|
||||
else
|
||||
else if (ld[10] > 1e0)
|
||||
PRINTMSG(" %6.1f",
|
||||
(double)ld[10]);
|
||||
else
|
||||
PRINTMSG(" %6.3f",
|
||||
(double)ld[10]);
|
||||
}
|
||||
|
||||
if (flag_o) {
|
||||
@ -481,8 +498,11 @@ main(int argc, char **argv)
|
||||
if (ld[12] > 1e3)
|
||||
PRINTMSG(" %6.0f",
|
||||
(double)ld[12]);
|
||||
else if (ld[12] > 1e0)
|
||||
PRINTMSG(" %6.1f",
|
||||
(double)ld[12]);
|
||||
else
|
||||
PRINTMSG(" %6.1f",
|
||||
PRINTMSG(" %6.3f",
|
||||
(double)ld[12]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user