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
Output Unit "Byte" for tikv-ctl #3421
Conversation
Hi contributor, thanks for your PR. This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically. |
src/bin/tikv-ctl.rs
Outdated
@@ -1805,7 +1805,7 @@ fn convert_gbmb(mut bytes: u64) -> String { | |||
const GB: u64 = 1024 * 1024 * 1024; | |||
const MB: u64 = 1024 * 1024; | |||
if bytes < MB { | |||
return bytes.to_string(); | |||
return format!("{} Byte ", bytes); |
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.
How about write the logic in convert_gbmb
?
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 {} B
is enough. see https://en.wikipedia.org/wiki/File_size
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.
@siddontang OK, I changed unit Byte to B.
@smallyard Thank you for this patch! :) |
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.
LGTM
Please add a new commit log to pass DCO check. |
62c669e
@hicqu I add a commit whih argument -s, but the check still not pass. |
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.
LGTM
@zhangjinpeng1987 please approve it |
What have you changed? (mandatory)
Output Unit "Byte" for tikv-ctl
What are the type of the changes? (mandatory)
Improvement
How has this PR been tested? (mandatory)
manual tests
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
no
Does this PR affect tidb-ansible update? (mandatory)
no
Refer to a related PR or issue link (optional)
#3186