jimsalterjrs/ioztat

Painting the bikeshed

Freaky opened this issue · 8 comments

Should bandwidth be changed to throughput? This is more correct, but deviates from zpool-iostat(8).

Should we default to binary mode, since that's all zpool-iostat(8) supports?

Should we default to a single iteration? This is what iostat(1) and zpool-iostat(8) both do. They also accept interval and count as positional arguments.

Is + as an ellipsis for truncated dataset names reasonable, or should it be ... despite the additional space it uses?

And #30, should we more closely follow ZFS number formatting conventions, or do we like our fixed 1 decimal place even if it needs a bit more room.

I vote "throughput" because "bandwidth" isn't an original iostat-ism, it exists only (and inaccurately!) in zpool iostat.

I vote power-of-two prefixes because that's what, to the best of my knowledge, all of the native operating systems this tool will run on use.

I personally like defaulting to the in-place continuously updated display, but I don't mind if we want to default to the iostat-like behavior because, hey, acting like iostat is a significant priority.

I vote + instead of ... because screen real estate in a monospaced terminal is at a premium.

I'm not sure I fully grok the difference between our current use of a fixed decimal where necessary or "ZFS formatting conventions."

bandwidth is hereby renamed throughput.

I merged a functionally identical workalike of ZFS's number formatting so we match what zpool-iostat(8) displays. This means the number of decimal places adjusts based on how big the number is.

If we default to binary mode, we either need a flag for decimal, or we could just follow ZFS and I believe most other iostat's and just leave it unconditional.

If you're willing to write it, I'd like to have a flag for decimal, for those poor saps who just insist on following hard drive marketers' lead in trying to make the numbers embiggen. If you're unwilling to write it, I'm perfectly happy with powers-of-two only.

We should have the "i" in the unit notation to indicate powers-of-two units, though. Eg KiB instead of KB.

Like this?

                                                 operations      throughput        opsize
dataset                                          read   write    read   write    read   write
---------------------------------------------  ------  ------  ------  ------  ------  ------
rpool/ROOT/default                                219       0   741Ki       0  3.38Ki       0
rpool/home/freaky                                   0       1       0     166       0     119
rpool/usr                                           6       0  11.8Ki       0  1.74Ki       0
rpool/usr/local                                   186       0  1.05Mi       0  5.77Ki       0
rpool/var                                           0       0       0  1.79Ki       0  4.51Ki
rpool/var/db                                        0       0       0    1007       0    1015
rpool/var/log                                       0       4  2.15Ki  3.87Ki  2.71Ki     950
rpool/var/run                                      20       0  4.31Ki       0     218       0

My eyes melt. I'd switch to decimal mode just to get rid of the i's.

I pushed it without the i, taking the -D flag for decimal mode, leaving -d free for future use. iostat uses it for "device only" mode to suppress tty and CPU statistics. Maybe we could use it for zvol's or something.

I think that's about it. We've changed bandwidth, we default to binary mode, we default to a single iteration with [interval [count]] positionals, we stuck with + as an ellipsis.

I suppose a CHANGELOG.md is in order, and some testing.

Think these are all resolved now.