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


##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -142,6 +168,46 @@
                         }
                     });
                 });
+
+            
$http.get("jmx?qry=Hadoop:service=SCMPipelineManager,name=SCMPipelineManagerInfo")
+                .then(function (result) {
+                    const URLScheme = location.protocol.replace(":" , "");
+                    ctrl.scmpipelinemanager = result.data.beans[0];
+                    ctrl.scmpipelinemanager.PipelineInfo.forEach(({key, 
value}) => {
+                        if(key == "CLOSED") {
+                            $scope.statistics.nodes.data.pipeline.closed = 
value;
+                        } else if(key == "ALLOCATED") {
+                            $scope.statistics.nodes.data.pipeline.allocated = 
value;
+                        } else if(key == "OPEN") {
+                            $scope.statistics.nodes.data.pipeline.open = value;
+                        } else if(key == "DORMANT") {
+                            $scope.statistics.nodes.data.pipeline.dormant = 
value;
+                        }
+                    });
+                });
+
+            
$http.get("jmx?qry=Hadoop:service=StorageContainerManager,name=ReplicationManagerMetrics")
+                .then(function (result) {
+                    const URLScheme = location.protocol.replace(":" , "");
+                    ctrl.scmcontainermanager = result.data.beans[0];
+                    $scope.statistics.nodes.data.container.open = 
ctrl.scmcontainermanager.OpenContainers;
+                    $scope.statistics.nodes.data.container.closing = 
ctrl.scmcontainermanager.ClosingContainers;
+                    $scope.statistics.nodes.data.container.quasi_closed = 
ctrl.scmcontainermanager.QuasiClosedContainers;
+                    $scope.statistics.nodes.data.container.closed = 
ctrl.scmcontainermanager.ClosedContainers;
+                    $scope.statistics.nodes.data.container.deleting = 
ctrl.scmcontainermanager.DeletingContainers;
+                    $scope.statistics.nodes.data.container.deleted = 
ctrl.scmcontainermanager.DeletedContainers;
+                    $scope.statistics.nodes.data.container.recovering = 
ctrl.scmcontainermanager.RecoveringContainers;
+                    $scope.statistics.nodes.data.container.under_replicated = 
ctrl.scmcontainermanager.UnderReplicatedContainers;
+                    $scope.statistics.nodes.data.container.mis_replicated = 
ctrl.scmcontainermanager.MisReplicatedContainers;
+                    $scope.statistics.nodes.data.container.over_replicated = 
ctrl.scmcontainermanager.OverReplicatedContainers;
+                    $scope.statistics.nodes.data.container.missing = 
ctrl.scmcontainermanager.MissingContainers;
+                    $scope.statistics.nodes.data.container.unhealthy = 
ctrl.scmcontainermanager.UnhealthyContainers;
+                    $scope.statistics.nodes.data.container.empty = 
ctrl.scmcontainermanager.EmptyContainers;
+                    $scope.statistics.nodes.data.container.open_unhealthy = 
ctrl.scmcontainermanager.OpenUnhealthyContainers;
+                    $scope.statistics.nodes.data.container.quasi_closed_stuck 
= ctrl.scmcontainermanager.StuckQuasiClosedContainers;
+                    
$scope.statistics.nodes.data.container.open_without_pipeline = 
ctrl.scmcontainermanager.OpenContainersWithoutPipeline;

Review Comment:
   Let's separate the prefix between the container lifecycle and health metrics:
   
   - Container lifecycle metrics: `statistics.container.lifecycle`
   - Health metrics: `statistics.container.health`



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html:
##########
@@ -110,6 +110,106 @@ <h2>Space Statistics</h2>
     </tbody>
 </table>
 
+<h2>Pipeline Statistics</h2>
+<table class="table table-bordered table-striped">
+    <tbody>
+    <tr>
+        <th>Pipeline State</th>
+        <th>Size</th>
+    </tr>
+    <tr>
+        <td>Closed</td>
+        <td>{{statistics.nodes.data.pipeline.closed}}</td>
+    </tr>
+    <tr>
+        <td>Allocated</td>
+        <td>{{statistics.nodes.data.pipeline.allocated}}</td>
+    </tr>
+    <tr>
+        <td>Open</td>
+        <td>{{statistics.nodes.data.pipeline.open}}</td>
+    </tr>
+    <tr>
+        <td>Dormant</td>
+        <td>{{statistics.nodes.data.pipeline.dormant}}</td>
+    </tr>
+    </tbody>
+</table>
+
+<h2>Container Statistics</h2>
+<table class="table table-bordered table-striped">

Review Comment:
   Let's separate this table into two smaller ones: one for "Lifecycle State" 
and "Health State"



##########
hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js:
##########
@@ -52,6 +52,32 @@
                         scmused : "N/A",
                         remaining : "N/A",
                         nonscmused : "N/A"
+                    },
+                    data : {
+                        pipeline : {
+                            closed : "N/A",
+                            allocated : "N/A",
+                            open : "N/A",
+                            dormant : "N/A"
+                        },
+                        container : {
+                            open : "N/A",
+                            closing : "N/A",
+                            quasi_closed : "N/A",
+                            closed : "N/A",
+                            deleting : "N/A",
+                            deleted : "N/A",
+                            recovering : "N/A",
+                            under_replicated : "N/A",
+                            mis_replicated : "N/A",
+                            over_replicated : "N/A",
+                            missing : "N/A",
+                            unhealthy : "N/A",
+                            empty : "N/A",
+                            open_unhealthy : "N/A",
+                            quasi_closed_stuck : "N/A",
+                            open_without_pipeline : "N/A"
+                        }

Review Comment:
   Could you flatten the hierarchy for different types of metrics? In my 
opinion, pipelines and containers do not "belong" to "nodes" so they should not 
be nested under it.
   
   I suggest something like:
   
   - datanode: `statistics.nodes`
   - pipeline: `statistics.pipelines`
   - containers: `statistics.containers`



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

Reply via email to