jrwest commented on code in PR #3628:
URL: https://github.com/apache/cassandra/pull/3628#discussion_r1815725510


##########
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:
   Another alternative is don't have it as a function, make the call inline. If 
we do make it a function we should find other places where the logic is the 
same and replace it. otherwise we have a utility method only used in one place. 



-- 
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