Permalink
Browse files

zpool iostat will print headers each time terminal fills

Each time terminal fills zpool iostat will print headers.
If -n flag is passed this behavior will be supressed.
  • Loading branch information...
madwizard committed Jan 6, 2019
1 parent ef62554 commit 943d6c08c4d36c72040d30889de59a80e086e694
Showing with 14 additions and 8 deletions.
  1. +4 −4 cmd/zpool/zpool_main.c
  2. +10 −4 man/man8/zpool.8
@@ -342,7 +342,7 @@ get_usage(zpool_help_t idx)
return (gettext("\tiostat [[[-c [script1,script2,...]"
"[-lq]]|[-rw]] [-T d | u] [-ghHLpPvy]\n"
"\t [[pool ...]|[pool vdev ...]|[vdev ...]]"
" [interval [count]]\n"));
" [[-n] interval [count]]\n"));
case HELP_LABELCLEAR:
return (gettext("\tlabelclear [-f] <vdev>\n"));
case HELP_LIST:
@@ -4785,7 +4785,7 @@ zpool_do_iostat(int argc, char **argv)
uint64_t unsupported_flags;

/* check options */
while ((c = getopt(argc, argv, "c:gLPT:vyhplqrwH")) != -1) {
while ((c = getopt(argc, argv, "c:gLPT:vyhplqrwnH")) != -1) {
switch (c) {
case 'c':
if (cmd != NULL) {
@@ -5065,9 +5065,9 @@ zpool_do_iostat(int argc, char **argv)
*
*/
if (((++cb.cb_iteration == 1 && !skip) ||
(skip != verbose)) &&
(skip != verbose) || (!headers_once && (cb.cb_iteration%winheight)==0)) &&
(!(cb.cb_flags & IOS_ANYHISTO_M)) &&
!cb.cb_scripted || (!headers_once && (cb.cb_iteration%winheight)==0))
!cb.cb_scripted)
print_iostat_header(&cb);

if (skip) {
@@ -118,7 +118,7 @@
.Cm iostat
.Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
.Op Fl T Sy u Ns | Ns Sy d
.Op Fl ghHLpPvy
.Op Fl ghHLpPvyn
.Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
.Op Ar interval Op Ar count
.Nm
@@ -1600,7 +1600,7 @@ Will also set -o cachefile=none when not explicitly specified.
.Cm iostat
.Op Oo Oo Fl c Ar SCRIPT Oc Oo Fl lq Oc Oc Ns | Ns Fl rw
.Op Fl T Sy u Ns | Ns Sy d
.Op Fl ghHLpPvy
.Op Fl ghHLpPvyn
.Oo Oo Ar pool Ns ... Oc Ns | Ns Oo Ar pool vdev Ns ... Oc Ns | Ns Oo Ar vdev Ns ... Oc Oc
.Op Ar interval Op Ar count
.Xc
@@ -1612,7 +1612,10 @@ When given an
.Ar interval ,
the statistics are printed every
.Ar interval
seconds until ^C is pressed. If count is specified, the command exits
seconds until ^C is pressed. If
.Fl n
flag is enabled headers are printed only once, otherwise they are
printed every time screen fills. If count is specified, the command exits
after count reports are printed. The first report printed is always
the statistics since boot regardless of whether
.Ar interval
@@ -1729,12 +1732,15 @@ pool, in addition to the pool-wide statistics.
Omit statistics since boot.
Normally the first line of output reports the statistics since boot.
This option suppresses that first line of output.
.It Fl n
Print headers only once when passed
.Ar interval
.It Fl w
Display latency histograms:
.Pp
.Ar total_wait :
Total IO time (queuing + disk IO time).
.Ar disk_wait :
.Ar disk_wait
Disk IO time (time reading/writing the disk).
.Ar syncq_wait :
Amount of time IO spent in synchronous priority queues. Does not include

0 comments on commit 943d6c0

Please sign in to comment.