You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/05/24 11:33:48 UTC

[GitHub] [dolphinscheduler] retime123 commented on a diff in pull request #10186: [Feature][Monitoring] Added disk available capacity monitoring

retime123 commented on code in PR #10186:
URL: https://github.com/apache/dolphinscheduler/pull/10186#discussion_r880390981


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java:
##########
@@ -92,6 +93,24 @@ public static double memoryUsage() {
         return Double.parseDouble(df.format(memoryUsage));
     }
 
+    /**
+     * get disk usage
+     * Keep 2 decimal
+     *
+     * @return disk free space  (GB)
+     */
+    public static double diskAvailable() {
+        File file = new File(".");
+        long totalSpace = file.getTotalSpace(); //total disk space in bytes.

Review Comment:
   totalSpace     Yes. It's not used



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org