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

Format name with all intermediates for disambiguation #6

Closed

Conversation

adriaandegroot
Copy link
Contributor

Fixes #5

This replaces the "just-the-rightmost-dataset-name-component" logic by "components-of-the-name-unique-after-the-previous-one". Output with default options looks like

dataset                                         w/s      wMB/s        r/s      rMB/s   wareq-sz   rareq-sz
zroot                                          0.00       0.00       0.00       0.00       0.00       0.00
   ROOT/default                                0.00       0.00       3.88       0.00       0.00       0.16
   tmp                                         0.00       0.00       0.00       0.00       0.00       0.00

(e.g. here instead of default being indented two, and ROOT being invisible, we get the dataset-name-components that distinguish it from zroot, the previously-printed name)

@Freaky
Copy link
Collaborator

Freaky commented Jan 15, 2022

I tried a similar approach and think it's less than ideal for readability:

dataset                                         w/s      wMB/s        r/s      rMB/s   wareq-sz   rareq-sz
rpool/ROOT/ubuntu_geaox3                       0.00       0.00       0.00       0.00       0.00       0.00
         srv                                   0.00       0.00       0.00       0.00       0.00       0.00

At a glance can you tell me where srv lives? It's fairly obvious it's not rpool if you're used to the standard indentation, but it's less obvious if it's under ROOT or ubuntu_geaox3.

From the same output:

   USERDATA/freaky_uik8tg                      0.00       0.00       0.00       0.00       0.00       0.00
      root_uik8tg                              0.00       0.00       0.00       0.00       0.00       0.00

Both of these live at the same level in the hierarchy, but are displayed differently and easily confused for nested datasets.

Freaky added a commit to Freaky/ioztat that referenced this pull request Jan 15, 2022
Fixes jimsalterjrs#5

This finds the longest common prefix of path segments since the last and
current dataset and prints any up to the final segment that have been
missed.

For example, a root mount at rpool/ROOT/default would previously be
displayed thus:

dataset
      default ...

This ensures the path leading up to it have their own lines:

dataset
rpool
   ROOT
      default ...

I believe this to be a more consistent fix than the one proposed in jimsalterjrs#6
where intermediates are formatted on a single line.
Freaky added a commit to Freaky/ioztat that referenced this pull request Jan 15, 2022
Fixes jimsalterjrs#5

This finds the longest common prefix of path segments since the last and
current dataset and prints any up to the final segment that have been
missed.

For example, a root mount at rpool/ROOT/default would previously be
displayed thus:

dataset
        default ...

This ensures the path leading up to it have their own lines:

dataset
rpool
    ROOT
        default ...

I believe this to be a more consistent fix than the one proposed in jimsalterjrs#6
where intermediates are formatted on a single line.
@jimsalterjrs
Copy link
Owner

is this branch dead now that I've accepted @Freaky's solution?

@jimsalterjrs
Copy link
Owner

I'm going to assume this one is effectively dead. Thanks for the contribution though, @adriaandegroot !

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.

Unmounted datasets lead to confusing gaps in output
3 participants