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

CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output #3069

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from

Conversation

zaaath
Copy link
Contributor

@zaaath zaaath commented Jan 28, 2024

Default to human-readable in nodetool tablestats. See a discussion on the topic in the dev mailing list dev@cassandra.apache.org

Before

nodetool tablestats doesn't use the human-readable formatting by default (with KiB/MiB/GiB units), instead it outputs data size values as is. In order to switch to the human-readable output, --human-readable or --H CLI flag is required.

After

nodetool tablestats uses the human-readable format by default. For backward compatibility --no-human-readable flag can be used to disable it.

How to reproduce

nodetool tablestats

and

nodetool tablestats --no-human-readable

Tests

ant testsome -Dtest.name=org.apache.cassandra.tools.nodetool.TableStatsTest
ant testsome -Dtest.name=org.apache.cassandra.tools.nodetool.stats.TableStatsPrinterTest

patch by @zaaath; reviewed by ??? for CASSANDRA-19335

description = "Display bytes in human readable form, i.e. KiB, MiB, GiB, TiB")
private boolean humanReadable = false;
@Option(title = "no_human_readable",
name = {"--no-human-readable"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we spare a short flag here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! How about -r (for Raw) or -nhr (for No Human Readable)? I'll add -r for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r short flag added (stands for Raw). Is there anything else missing here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-r works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants