prashantwason commented on a change in pull request #2496:
URL: https://github.com/apache/hudi/pull/2496#discussion_r568228504



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/fs/HoodieWrapperFileSystem.java
##########
@@ -118,12 +156,31 @@ private static Registry getMetricRegistryForPath(Path p) {
     return executeFuncWithTimeMetrics(metricName, p, func);
   }
 
+  /**
+   * Executes the given function and updates the metric with time taken to 
execute the function and number of bytes.
+   *
+   * The number of bytes are returned from the execution of the provided 
function.
+   */
+  protected static int executeFuncWithTimeAndByteMetrics(String metricName, 
Path p, CheckedIntFunction func) throws IOException {
+    int ret = executeFuncWithTimeMetrics(metricName, p, func);
+    if (ret > 0) {
+      Registry registry = getMetricRegistryForPath(p);
+      if (registry != null) {

Review comment:
       Optimized.




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

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


Reply via email to