chengw-netflix commented on code in PR #3628:
URL: https://github.com/apache/cassandra/pull/3628#discussion_r1815744086


##########
src/java/org/apache/cassandra/tools/nodetool/stats/CompactionHistoryHolder.java:
##########
@@ -82,12 +85,17 @@ private HashMap<String, Object> getAllAsMap()
             Instant instant = Instant.ofEpochMilli(this.compactedAt);
             LocalDateTime ldt = LocalDateTime.ofInstant(instant, 
ZoneId.systemDefault());
             compaction.put("compacted_at", ldt.toString());
-            compaction.put("bytes_in", this.bytesIn);
-            compaction.put("bytes_out", this.bytesOut);
+            compaction.put("bytes_in", format(this.bytesIn, humanReadable));
+            compaction.put("bytes_out", format(this.bytesOut, humanReadable));
             compaction.put("rows_merged", this.rowMerged);
             compaction.put("compaction_properties", this.compactionProperties);
             return compaction;
         }
+
+        private String format(long bytes, boolean humanReadable)

Review Comment:
   I would generally prefer to put the logic into the stringifyFileSize and 
pass `humanReadable` to it because the TableStatsHolder also has its private 
format() method. Additionally, it would benefit other nodetool commands to have 
the -H options if yet has(I plan to vet all other nodetool commands separately 
later). 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to