OneSizeFitsQuorum commented on code in PR #11289:
URL: https://github.com/apache/iotdb/pull/11289#discussion_r1356172448


##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/utils/SystemMetric.java:
##########
@@ -58,6 +58,7 @@ public enum SystemMetric {
   SYS_COMMITTED_VM_SIZE("sys_committed_vm_size"),
   SYS_DISK_TOTAL_SPACE("sys_disk_total_space"),
   SYS_DISK_FREE_SPACE("sys_disk_free_space"),
+  SYS_AVAILABLE_SPACE("sys_available_space"),

Review Comment:
   ```suggestion
   SYS_DISK_AVAILABLE_SPACE("sys_disk_available_space"),
   ```



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/CompactionUtils.java:
##########
@@ -473,7 +473,7 @@ public static boolean isDiskHasSpace(double redundancy) {
     double freeDisk =

Review Comment:
   availableDisk



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java:
##########
@@ -1277,7 +1277,7 @@ private void sampleDiskLoad(TLoadSample loadSample) {
     double freeDisk =

Review Comment:
   availableDisk



##########
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/system/SystemMetrics.java:
##########
@@ -235,6 +247,18 @@ public long getSystemDiskTotalSpace() {
   }
 
   public long getSystemDiskFreeSpace() {
+    long sysFreeSpace = 0L;
+    for (FileStore fileStore : fileStores) {
+      try {
+        sysFreeSpace += fileStore.getUnallocatedSpace();
+      } catch (IOException e) {
+        logger.error("Failed to statistic the size of {}, because", fileStore, 
e);
+      }
+    }
+    return sysFreeSpace;
+  }
+
+  public long getSystemAvailableSpace() {
     long sysFreeSpace = 0L;

Review Comment:
   sysAvailableSpace



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