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


##########
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 think committed and freeSpaceToSpare are secondary and don't need to be 
shown here. Therefore, I didn't handle them.



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