Add an '-a' switch to only display providers that are at least
0.1% busy. OK'ed by: phk
This commit is contained in:
parent
00bd8f10be
commit
be75dba724
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136354
@ -32,7 +32,7 @@
|
||||
.Nd print statistics about GEOM disks
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl cd
|
||||
.Op Fl acd
|
||||
.Op Fl I Ar interval
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
@ -43,6 +43,8 @@ devices.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width indent
|
||||
.It Fl a
|
||||
Only display providers that are at least 0.1% busy.
|
||||
.It Fl c
|
||||
Enable display of
|
||||
.Xr geom 4
|
||||
|
@ -47,7 +47,7 @@
|
||||
#include <devstat.h>
|
||||
#include <sys/devicestat.h>
|
||||
|
||||
static int flag_c, flag_d;
|
||||
static int flag_a, flag_c, flag_d;
|
||||
static int flag_I = 500000;
|
||||
|
||||
static void usage(void);
|
||||
@ -69,8 +69,11 @@ main(int argc, char **argv)
|
||||
long double ld[11];
|
||||
uint64_t u64;
|
||||
|
||||
while ((i = getopt(argc, argv, "dcI:")) != -1) {
|
||||
while ((i = getopt(argc, argv, "adcI:")) != -1) {
|
||||
switch (i) {
|
||||
case 'a':
|
||||
flag_a = 1;
|
||||
break;
|
||||
case 'c':
|
||||
flag_c = 1;
|
||||
break;
|
||||
@ -187,6 +190,11 @@ main(int argc, char **argv)
|
||||
DSM_MS_PER_TRANSACTION_FREE, &ld[10],
|
||||
DSM_NONE);
|
||||
|
||||
if (flag_a && ld[7] < 0.1) {
|
||||
*gsq = *gsp;
|
||||
continue;
|
||||
}
|
||||
|
||||
printw(" %4ju", (uintmax_t)u64);
|
||||
printw(" %6.0f", (double)ld[0]);
|
||||
printw(" %6.0f", (double)ld[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user