lw309637554 commented on a change in pull request #3487:
URL: https://github.com/apache/hudi/pull/3487#discussion_r689961526



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/utils/FileSliceMetricUtils.java
##########
@@ -44,19 +44,23 @@ public static void 
addFileSliceCommonMetrics(List<FileSlice> fileSlices, Map<Str
     long totalIO = 0;
 
     for (FileSlice slice : fileSlices) {
-      numLogFiles +=  slice.getLogFiles().count();
+      numLogFiles += slice.getLogFiles().count();
       // Total size of all the log files
       totalLogFileSize += 
slice.getLogFiles().map(HoodieLogFile::getFileSize).filter(size -> size >= 0)
           .reduce(Long::sum).orElse(0L);
 
       long baseFileSize = slice.getBaseFile().isPresent() ? 
slice.getBaseFile().get().getFileSize() : 0L;
       // Total read will be the base file + all the log files
-      totalIORead = FSUtils.getSizeInMB(baseFileSize + totalLogFileSize);
+      totalIORead += baseFileSize;
       // Total write will be similar to the size of the base file
-      totalIOWrite = FSUtils.getSizeInMB(baseFileSize > 0 ? baseFileSize : 
defaultBaseFileSize);
-      // Total IO will the the IO for read + write
-      totalIO = totalIORead + totalIOWrite;
+      totalIOWrite += baseFileSize > 0 ? baseFileSize : defaultBaseFileSize;
+
     }
+    // Total IO will the the IO for read + write

Review comment:
       Total IO will the the IO for read + write -> Total IO will the IO for 
read + write




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


Reply via email to