FreeBSD Bugzilla – Attachment 174833 Details for
Bug 212726
[patch][gstat] Add blocks' size to stastistics and add -B for continuous batch mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add blocks' size to gstat
gstat.patch (text/plain), 4.04 KB, created by
Ben RUBSON
on 2016-09-16 14:18:20 UTC
(
hide
)
Description:
Add blocks' size to gstat
Filename:
MIME Type:
Creator:
Ben RUBSON
Created:
2016-09-16 14:18:20 UTC
Size:
4.04 KB
patch
obsolete
>--- gstat.8.orig 2016-08-12 02:08:41.000000000 +0200 >+++ gstat.8 2016-09-16 16:13:53.160993000 +0200 >@@ -32,7 +32,7 @@ > .Nd print statistics about GEOM disks > .Sh SYNOPSIS > .Nm >-.Op Fl abcdop >+.Op Fl abBcdops > .Op Fl f Ar filter > .Op Fl I Ar interval > .Sh DESCRIPTION >@@ -50,6 +50,10 @@ > Batch mode. > Collect numbers, print and exit. > Default if stdout is not a tty. >+.It Fl B >+Endless batch mode. >+Same as batch mode, but dont exit after collecting >+the first set of data. > .It Fl c > Enable display of > .Xr geom 4 >@@ -72,6 +76,8 @@ > .It Fl o > Enable display of statistics for other operations > .Pq Dv BIO_FLUSH . >+.It Fl s >+Enable blocks' size statistics. > .It Fl I Ar interval > Refresh the > .Nm >--- gstat.c.orig 2016-08-12 02:08:41.000000000 +0200 >+++ gstat.c 2016-09-16 16:16:07.586030000 +0200 >@@ -51,11 +51,11 @@ > #include <sysexits.h> > #include <unistd.h> > >-static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p; >+static int flag_a, flag_b, flag_B, flag_c, flag_d, flag_o, flag_p, flag_s; > static int flag_I = 1000000; > > #define PRINTMSG(...) do { \ >- if (flag_b && !loop) \ >+ if ((flag_b && !loop) || (flag_B)) \ > printf(__VA_ARGS__); \ > else if (!flag_b) \ > printw(__VA_ARGS__); \ >@@ -88,7 +88,7 @@ > char *p; > char f_s[100], pf_s[100], tmp_f_s[100]; > const char *line; >- long double ld[13]; >+ long double ld[16]; > uint64_t u64; > EditLine *el; > History *hist; >@@ -104,7 +104,7 @@ > flag_b = 1; > > f_s[0] = '\0'; >- while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) { >+ while ((i = getopt(argc, argv, "abBdcf:I:ops")) != -1) { > switch (i) { > case 'a': > flag_a = 1; >@@ -112,6 +112,10 @@ > case 'b': > flag_b = 1; > break; >+ case 'B': >+ flag_B = 1; >+ flag_b = 1; >+ break; > case 'c': > flag_c = 1; > break; >@@ -146,6 +150,9 @@ > case 'p': > flag_p = 1; > break; >+ case 's': >+ flag_s = 1; >+ break; > case '?': > default: > usage(); >@@ -208,7 +215,8 @@ > > geom_stats_snapshot_reset(sp); > geom_stats_snapshot_reset(sq); >- move(0,0); >+ if (!flag_b) >+ move(0,0); > PRINTMSG("dT: %5.3fs w: %.3fs", dt, (float)flag_I / 1000000); > if (f_s[0] != '\0') { > PRINTMSG(" filter: "); >@@ -231,10 +239,20 @@ > } > PRINTMSG("\n"); > PRINTMSG(" L(q) ops/s "); >- PRINTMSG(" r/s kBps ms/r "); >- PRINTMSG(" w/s kBps ms/w "); >- if (flag_d) >- PRINTMSG(" d/s kBps ms/d "); >+ if (flag_s) { >+ PRINTMSG(" r/s kB kBps ms/r "); >+ PRINTMSG(" w/s kB kBps ms/w "); >+ } >+ else { >+ PRINTMSG(" r/s kBps ms/r "); >+ PRINTMSG(" w/s kBps ms/w "); >+ } >+ if (flag_d) { >+ if (flag_s) >+ PRINTMSG(" d/s kB kBps ms/d "); >+ else >+ PRINTMSG(" d/s kBps ms/d "); >+ } > if (flag_o) > PRINTMSG(" o/s ms/o "); > PRINTMSG("%%busy Name\n"); >@@ -298,6 +316,10 @@ > DSM_TRANSFERS_PER_SECOND_OTHER, &ld[11], > DSM_MS_PER_TRANSACTION_OTHER, &ld[12], > >+ DSM_KB_PER_TRANSFER_READ, &ld[13], >+ DSM_KB_PER_TRANSFER_WRITE, &ld[14], >+ DSM_KB_PER_TRANSFER_FREE, &ld[15], >+ > DSM_NONE); > > if (flag_a && ld[7] < 0.1) { >@@ -308,12 +330,16 @@ > PRINTMSG(" %4ju", (uintmax_t)u64); > PRINTMSG(" %6.0f", (double)ld[0]); > PRINTMSG(" %6.0f", (double)ld[1]); >+ if (flag_s) >+ PRINTMSG(" %6.0f", (double)ld[13]); > PRINTMSG(" %6.0f", (double)ld[2] * 1024); > if (ld[3] > 1e3) > PRINTMSG(" %6.0f", (double)ld[3]); > else > PRINTMSG(" %6.1f", (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]); >@@ -322,6 +348,8 @@ > > if (flag_d) { > PRINTMSG(" %6.0f", (double)ld[8]); >+ if (flag_s) >+ PRINTMSG(" %6.0f", (double)ld[15]); > PRINTMSG(" %6.0f", (double)ld[9] * 1024); > if (ld[10] > 1e3) > PRINTMSG(" %6.0f", (double)ld[10]); >@@ -373,7 +401,10 @@ > /* We loop extra to make sure we get the information. */ > if (!loop) > break; >- loop = 0; >+ if (!flag_B) >+ loop = 0; >+ else >+ fflush(stdout); > usleep(flag_I); > continue; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212726
:
174827
| 174833