raw filesystem counters

Eric A. Borisch eborisch at gmail.com
Tue Feb 20 20:24:57 UTC 2018

On Tue, Feb 13, 2018 at 1:56 PM, E.S. Rosenberg
<esr+freebsd-fs at mail.hebrew.edu> wrote:
> Wow Eric that is exactly what I was looking for!
> Thanks!
> Nothing similar exists for ZFS correct?
> Thanks again,
> Eli

Here's a quick patch to zpool that adds a "raw" mode when
ZPOOL_RAW_STATS is set (to anything) in the environment. Outputs are
not averaged by time, so the first output has absolute counters from
boot, and subsequent (if provided an interval, eg zpool iostat 5) *are
not* averaged over the period. You could certainly average for
interval but not initial; I just chose to remove all averaging.


Could also be implemented as a -p (parsable) flag to zpool iostat, but
this was less intrusive to code up.

On my system (with the above patch):

$  zpool iostat

               capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
system      67.2G  13.8G      9     51   159K   879K
tome        2.94T   697G     19     34   949K   645K
----------  -----  -----  -----  -----  -----  -----

$ ZPOOL_RAW_STATS=1 zpool iostat


$ ZPOOL_RAW_STATS=1 zpool iostat -v


With an uptime of ~51 days.

  - Eric

More information about the freebsd-fs mailing list