diff options
author | Pascal666 <Pascal@rkfd.com> | 2018-03-05 13:17:18 -0600 |
---|---|---|
committer | Prakash Surya <prakash.surya@delphix.com> | 2018-03-21 08:25:34 -0700 |
commit | 0a052a62e5b55bf138983a4b3ef88eb752006ae4 (patch) | |
tree | 9bac9ef5afa046eb5aab6aef46e4b29ce6cfc858 | |
parent | 268bbb2a2fa79c36d4695d13a595ba50a7754b76 (diff) | |
download | illumos-joyent-0a052a62e5b55bf138983a4b3ef88eb752006ae4.tar.gz |
9322 Print stats since boot for first line of arcstat.pl
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
-rwxr-xr-x | usr/src/cmd/stat/arcstat/arcstat.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/cmd/stat/arcstat/arcstat.pl b/usr/src/cmd/stat/arcstat/arcstat.pl index 8f13221910..d4f12a9e1c 100755 --- a/usr/src/cmd/stat/arcstat/arcstat.pl +++ b/usr/src/cmd/stat/arcstat/arcstat.pl @@ -166,8 +166,11 @@ sub init { detailed_usage() if $vflag; @hdr = @xhdr if $xflag; #reset headers to xhdr - # check if L2ARC exists + # we want to capture the stats here, so that we can use them to check + # if an L2ARC device exists; but more importantly, so that we print + # the stats since boot as the first line of output from main(). snap_stats(); + if (defined $cur{"l2_size"}) { $l2exist = 1; } @@ -353,12 +356,12 @@ sub main { if ($count > 0) { $count_flag = 1; } while (1) { print_header() if ($i == 0); - snap_stats(); calculate(); print_values(); last if ($count_flag == 1 && $count-- <= 1); $i = (($i == $hdr_intr) && (not $raw_output)) ? 0 : $i+1; sleep($int); + snap_stats(); } close($out) if defined $out; } |