You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "zaaath (via GitHub)" <gi...@apache.org> on 2024/01/28 16:54:50 UTC

[PR] CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output [cassandra]

zaaath opened a new pull request, #3069:
URL: https://github.com/apache/cassandra/pull/3069

   Default to human-readable in `nodetool tablestats`. See a discussion on the topic in the dev mailing list [dev@cassandra.apache.org](https://lists.apache.org/thread/mlp715kxho5b6f1ql9omlzmmnh4qfby9)
   
   ### 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
   ```bash
   nodetool tablestats
   ```
   and
   ```bash
   nodetool tablestats --no-human-readable
   ```
   
   Tests
   ```bash
   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-19104](https://issues.apache.org/jira/browse/CASSANDRA-19335)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output [cassandra]

Posted by "zaaath (via GitHub)" <gi...@apache.org>.
zaaath commented on code in PR #3069:
URL: https://github.com/apache/cassandra/pull/3069#discussion_r1479218714


##########
src/java/org/apache/cassandra/tools/nodetool/TableStats.java:
##########
@@ -36,10 +36,10 @@ public class TableStats extends NodeToolCmd
     @Option(name = "-i", description = "Ignore the list of tables and display the remaining tables")
     private boolean ignore = false;
 
-    @Option(title = "human_readable",
-            name = {"-H", "--human-readable"},
-            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"},

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output [cassandra]

Posted by "zaaath (via GitHub)" <gi...@apache.org>.
zaaath commented on code in PR #3069:
URL: https://github.com/apache/cassandra/pull/3069#discussion_r1479230427


##########
src/java/org/apache/cassandra/tools/nodetool/TableStats.java:
##########
@@ -36,10 +36,10 @@ public class TableStats extends NodeToolCmd
     @Option(name = "-i", description = "Ignore the list of tables and display the remaining tables")
     private boolean ignore = false;
 
-    @Option(title = "human_readable",
-            name = {"-H", "--human-readable"},
-            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"},

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output [cassandra]

Posted by "driftx (via GitHub)" <gi...@apache.org>.
driftx commented on code in PR #3069:
URL: https://github.com/apache/cassandra/pull/3069#discussion_r1469733522


##########
src/java/org/apache/cassandra/tools/nodetool/TableStats.java:
##########
@@ -36,10 +36,10 @@ public class TableStats extends NodeToolCmd
     @Option(name = "-i", description = "Ignore the list of tables and display the remaining tables")
     private boolean ignore = false;
 
-    @Option(title = "human_readable",
-            name = {"-H", "--human-readable"},
-            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"},

Review Comment:
   Can we spare a short flag here too?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-19335 Default nodetool tablestats to Human-Readable Output [cassandra]

Posted by "driftx (via GitHub)" <gi...@apache.org>.
driftx commented on code in PR #3069:
URL: https://github.com/apache/cassandra/pull/3069#discussion_r1479631903


##########
src/java/org/apache/cassandra/tools/nodetool/TableStats.java:
##########
@@ -36,10 +36,10 @@ public class TableStats extends NodeToolCmd
     @Option(name = "-i", description = "Ignore the list of tables and display the remaining tables")
     private boolean ignore = false;
 
-    @Option(title = "human_readable",
-            name = {"-H", "--human-readable"},
-            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"},

Review Comment:
   -r works for me, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org