-
Notifications
You must be signed in to change notification settings - Fork 562
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
Humanize object size #4766
Humanize object size #4766
Conversation
Updated the 'mc stat' command's output to humanize the object sizes in the histogram section. It improves readability by formatting large numbers with commas.
Implemented the changes necessary for automated testing humanized object count function
Created a function with large number for mock data at 1 billion.
- Refactor stat_test.go to improve readability and maintainability - Update test cases to use struct literals for better clarity and organization
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.
One comment
Update expectedHumanizedSize values in TestParseStat Remove TestHumanizedHistogramOutput function
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.
Think it’s all caught up, let me know what anyone thinks.
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
|
I am adding bubbletea to the mc stat.go to give it a more appealing output. |
Please resubmit when its ready @Cdaprod |
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the [Apache 2 license] (https://www.apache.org/licenses/LICENSE-2.0).
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
This PR introduces enhancements to stat.go in the MinIO mc tool, implementing humanized formatting for object counts in the mc stat command output. By adopting comma-separated values, this update significantly improves the readability of large numbers.
Furthermore, the stat_test.go file has been augmented to include comprehensive tests for these new formatting features. These tests rigorously verify that the humanized output adheres to the expected format across a range of scenarios.
Changes Summary
stat.go
: Modified to apply humanized formatting usinghumanize.Comma
.stat_test.go
: Added new test cases and assertions to validate the humanized output.These changes aim to enhance the readability of the
mc stat
command output, particularly when dealing with large object counts.Motivation and Context
When dealing with large object counts, it's easier for users to read and understand the numbers when they're formatted with commas. This change enhances the user experience by making the output of
mc stat
more accessible, especially when presenting large datasets.How to test this PR?
mc stat
command with various bucket sizes to ensure the output is formatted correctly.Manual Testing of mc stat
Automated Testing
The tests should cover various scenarios and check if the humanized output is as expected for different object sizes.
These tests ensure that both the new functionality and existing features of the mc stat command work as intended.
Types of changes
Checklist:
commit-id
orPR #
here)