-
Notifications
You must be signed in to change notification settings - Fork 1
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 '-group-by' flag to compute aggregated disk usage #48
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, and the implementation looks good. Can you past the output of the table in the PR description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the example! It made it far easier to understand the changes. I've left some comments, tho, which I'd love to discuss. I created a different thread for each one so it's easier to discuss.
|
||
w := tabwriter.NewWriter(os.Stdout, 8, 4, 2, ' ', 0) | ||
|
||
headers := []string{"PROVIDER", "GROUP_BY", "TYPE", "SIZE_GB"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure GROUP_BY
is clear enough as a column header. I'd love to have the value passed by the user for the -group-by
flag, although I'm not sure how would that look in the case of something like kubernetes.io/created-for/pvc/namespace
for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have doubts here as well and can't find good enough solution for column name.
Tag names are long and also confusing when I tried to use them.
I have 3 ideas:
- add comment about grouping tag when run with
-v
flag and useGROUP_BY_TAG
as column nameGrouping by 'kubernetes.io/created-for/pvc/namespace' tag. PROVIDER GROUP_BY_TAG TYPE DISKS_COUNT TOTAL_SIZE_GB GCP redis-test ssd 3 9
- print group-by name as column
PROVIDER kubernetes.io/created-for/pvc/namespace TYPE DISKS_COUNT TOTAL_SIZE_GB GCP redis-test ssd 3 9
- print upcased group-by name
PROVIDER KUBERNETES.IO/CREATED-FOR/PVC/NAMESPACE TYPE DISKS_COUNT TOTAL_SIZE_GB GCP redis-test ssd 3 9
what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like the second option the better. It's definitely a hard question to answer 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few more comments, mostly aesthetic.
thanks @inkel , addressed all your comments :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Thanks!
Draft on how "Group by" functionality could be added.
Example output: