smiklosovic commented on code in PR #4551:
URL: https://github.com/apache/cassandra/pull/4551#discussion_r2704354243


##########
src/java/org/apache/cassandra/tools/nodetool/CompactionStats.java:
##########
@@ -162,9 +181,22 @@ public static void 
reportCompactionTable(List<Map<String,String>> compactions, l
         }
 
         String remainingTime = "n/a";
-        if (compactionThroughputInBytes != 0)
+        long throughputInBytes = 0;
+        
+        // Use current compaction throughput (1 minute) if available and > 0, 
otherwise fall back to configured throughput
+        if (currentCompactionThroughputMiBPerSec != null && 
currentCompactionThroughputMiBPerSec > 0)
+        {
+            // Convert MiB/s to bytes/s (1 MiB = 1024 * 1024 bytes)
+            throughputInBytes = (long) (currentCompactionThroughputMiBPerSec * 
1024 * 1024);

Review Comment:
   can  you avoid this casting to long by making 
`currentCompactionThroughputMiBPerSec` as `long` already? Can you also _not_ do 
this "math" at this place? We can do that upon parsing that value. That would 
make `currentCompactionThroughputMiBPerSec` to be called 
`currentCompactionThroughputBytesPerSec`.



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