ivandika3 commented on code in PR #7005:
URL: https://github.com/apache/ozone/pull/7005#discussion_r1704997718


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1265,6 +1275,38 @@ private void nodeUsageStatistics(Map<String, String> 
nodeStatics) {
     nodeStatics.put(UsageStatics.STDEV.getLabel(), decimalFormat.format(dev));
   }
 
+  private void nodeSpaceStatistics(Map<String, String> nodeStatics) {
+    if (nodeStateManager.getAllNodes().size() < 1) {
+      return;
+    }
+    long capacityByte = 0;
+    long scmUsedByte = 0;
+    long remainingByte = 0;
+    for (DatanodeInfo dni : nodeStateManager.getAllNodes()) {
+      List<StorageReportProto> storageReports = dni.getStorageReports();
+      if (storageReports != null && !storageReports.isEmpty()) {
+        for (StorageReportProto storageReport : storageReports) {
+          capacityByte += storageReport.getCapacity();
+          scmUsedByte += storageReport.getScmUsed();
+          remainingByte += storageReport.getRemaining();

Review Comment:
   I meant that `StorageReportProto` contains two possible relevant fields 
`committed` and `freeSpaceToSpare`, but here we only get the `capacity`, 
`scmUsed`, and `remaining`. Do we need to include the `committed` and 
`freeSpaceToSpare` here? I'm fine if you don't think it's relevant for now.



-- 
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: issues-unsubscr...@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to