zhongjiajie commented on code in PR #10749:
URL: https://github.com/apache/dolphinscheduler/pull/10749#discussion_r914391522


##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/metrics/WorkerServerMetrics.java:
##########
@@ -17,11 +17,10 @@
 
 package org.apache.dolphinscheduler.server.worker.metrics;
 
+import java.util.concurrent.TimeUnit;
 import java.util.function.Supplier;
 
-import io.micrometer.core.instrument.Counter;
-import io.micrometer.core.instrument.Gauge;
-import io.micrometer.core.instrument.Metrics;
+import io.micrometer.core.instrument.*;

Review Comment:
   should avoid add `import *` to our code base



##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java:
##########
@@ -244,4 +244,15 @@ public static boolean directoryTraversal(String filename){
         }
     }
 
+    /**
+     * Get file size in KB
+     *
+     * @param filename String type of filename
+     * @return file size in KB
+     */
+    public static double getFileSizeInKB(String filename){
+        File file = new File(filename);
+        return ((double) file.length()) / 1024;

Review Comment:
   how about add 1024 to constants?



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