Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unlink statistics behind an -x flag #33

Merged
merged 5 commits into from
Feb 8, 2022
Merged

Add unlink statistics behind an -x flag #33

merged 5 commits into from
Feb 8, 2022

Conversation

Freaky
Copy link
Collaborator

@Freaky Freaky commented Feb 5, 2022

Add the two other fields ZFS exposes: nunlinked, the number of files
unlinked from the filesystem, and nunlinks, which includes the number
that have been queued.

Add an -x flag for extended statistics. Hide both opsize and nunlinks
by default to make for a clear display, with -x to add opsize and -xx to
add both that and unlink statistics.

Add the two other fields ZFS exposes: nunlinked, the number of files
unlinked from the filesystem, and nunlinks, which includes the number
that have been queued.

Add an -x flag for extended statistics.  Hide both opsize and nunlinks
by default to make for a clear display, with -x to add opsize and -xx to
add both that and unlink statistics.
@Freaky
Copy link
Collaborator Author

Freaky commented Feb 5, 2022

Adding unlinks seems sensible, given they're the other values ZFS sees fit to expose.

What do we think about the flag usage, though? Hiding opsize by default, -xx? I quite like the tidy 4 columns, but these could be two different flags if we really wanted.

Instead of columns having a title and an implicit index, give columns an
explicit key from which to uniquely identify them.

Replace print_columns() with add_row() using keys to identify column
data.

This decouples column ordering from most of the code.
Instead of using parameters to a slice and making assumptions about
column order, teach get_printed_width to exclude a list of named columns
from its calculation regardless of their position.

While here, hoist the calculation outside the main loop since these
values aren't dynamic.
Set COLUMNS=80 for generating help text for README, and tweak
descriptions to fit more tidily.
@Freaky Freaky marked this pull request as ready for review February 8, 2022 00:57
@Freaky Freaky merged commit 49edb85 into main Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant