ivandika3 commented on code in PR #7005:
URL: https://github.com/apache/ozone/pull/7005#discussion_r1704913438
##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html:
##########
@@ -51,6 +51,26 @@ <h2>Statistics</h2>
<td>Standard Deviation</td>
<td>{{statistics.nodes.usages.stdev}}</td>
</tr>
+ <tr>
+ <th>Datanode Space</th>
+ <th>Size</th>
+ </tr>
+ <tr>
+ <td>Capacity</td>
+ <td>{{statistics.nodes.space.capacity}}</td>
+ </tr>
+ <tr>
+ <td>Scmused</td>
+ <td>{{statistics.nodes.space.scmused}}</td>
+ </tr>
+ <tr>
+ <td>Remaining</td>
+ <td>{{statistics.nodes.space.remaining}}</td>
+ </tr>
+ <tr>
+ <td>NonScmused</td>
+ <td>{{statistics.nodes.space.nonscmused}}</td>
+ </tr>
Review Comment:
Can be put into a separate table.
##########
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:
There are two more relevant `StorageReportProto`, `committed` and
`freeSpaceToSpare`. Do we need to include these?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]