From 6b872073b9769482e01b89090bfb19f53d388690 Mon Sep 17 00:00:00 2001 From: jianghuazhu <740087514@qq.com> Date: Wed, 25 Sep 2024 10:51:59 +0800 Subject: [PATCH] HDDS-11469. Statistics of Pipeline and Container (#7217) --- .../resources/webapps/scm/scm-overview.html | 108 ++++++++++++++++++ .../src/main/resources/webapps/scm/scm.js | 68 +++++++++++ 2 files changed, 176 insertions(+) diff --git a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html index 0f233bf4ea1..2748716e67f 100644 --- a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html +++ b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm-overview.html @@ -110,6 +110,114 @@

Space Statistics

+

Pipeline Statistics

+ + + + + + + + + + + + + + + + + + + + + + + +
Pipeline StateSize
Closed{{statistics.pipelines.closed}}
Allocated{{statistics.pipelines.allocated}}
Open{{statistics.pipelines.open}}
Dormant{{statistics.pipelines.dormant}}
+ +

Container Statistics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operational StateSize
Open{{statistics.containers.lifecycle.open}}
Closing{{statistics.containers.lifecycle.closing}}
Quasi Closed{{statistics.containers.lifecycle.quasi_closed}}
Closed{{statistics.containers.lifecycle.closed}}
Deleting{{statistics.containers.lifecycle.deleting}}
Deleted{{statistics.containers.lifecycle.deleted}}
Recovering{{statistics.containers.lifecycle.recovering}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HealthSize
Under Replicated{{statistics.containers.health.under_replicated}}
Mis Replicated{{statistics.containers.health.mis_replicated}}
Over Replicated{{statistics.containers.health.over_replicated}}
Missing{{statistics.containers.health.missing}}
Unhealthy{{statistics.containers.health.unhealthy}}
Empty{{statistics.containers.health.empty}}
Open Unhealthy{{statistics.containers.health.open_unhealthy}}
Quasi Closed Stuck{{statistics.containers.health.quasi_closed_stuck}}
Open Without Pipeline{{statistics.containers.health.open_without_pipeline}}
+

Node Status

diff --git a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js index e00f8b8ede8..fc216c06862 100644 --- a/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js +++ b/hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js @@ -53,6 +53,34 @@ remaining : "N/A", nonscmused : "N/A" } + }, + pipelines : { + closed : "N/A", + allocated : "N/A", + open : "N/A", + dormant : "N/A" + }, + containers : { + lifecycle : { + open : "N/A", + closing : "N/A", + quasi_closed : "N/A", + closed : "N/A", + deleting : "N/A", + deleted : "N/A", + recovering : "N/A" + }, + health : { + 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" + } } } @@ -142,6 +170,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.pipelines.closed = value; + } else if(key == "ALLOCATED") { + $scope.statistics.pipelines.allocated = value; + } else if(key == "OPEN") { + $scope.statistics.pipelines.open = value; + } else if(key == "DORMANT") { + $scope.statistics.pipelines.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.containers.lifecycle.open = ctrl.scmcontainermanager.OpenContainers; + $scope.statistics.containers.lifecycle.closing = ctrl.scmcontainermanager.ClosingContainers; + $scope.statistics.containers.lifecycle.quasi_closed = ctrl.scmcontainermanager.QuasiClosedContainers; + $scope.statistics.containers.lifecycle.closed = ctrl.scmcontainermanager.ClosedContainers; + $scope.statistics.containers.lifecycle.deleting = ctrl.scmcontainermanager.DeletingContainers; + $scope.statistics.containers.lifecycle.deleted = ctrl.scmcontainermanager.DeletedContainers; + $scope.statistics.containers.lifecycle.recovering = ctrl.scmcontainermanager.RecoveringContainers; + $scope.statistics.containers.health.under_replicated = ctrl.scmcontainermanager.UnderReplicatedContainers; + $scope.statistics.containers.health.mis_replicated = ctrl.scmcontainermanager.MisReplicatedContainers; + $scope.statistics.containers.health.over_replicated = ctrl.scmcontainermanager.OverReplicatedContainers; + $scope.statistics.containers.health.missing = ctrl.scmcontainermanager.MissingContainers; + $scope.statistics.containers.health.unhealthy = ctrl.scmcontainermanager.UnhealthyContainers; + $scope.statistics.containers.health.empty = ctrl.scmcontainermanager.EmptyContainers; + $scope.statistics.containers.health.open_unhealthy = ctrl.scmcontainermanager.OpenUnhealthyContainers; + $scope.statistics.containers.health.quasi_closed_stuck = ctrl.scmcontainermanager.StuckQuasiClosedContainers; + $scope.statistics.containers.health.open_without_pipeline = ctrl.scmcontainermanager.OpenContainersWithoutPipeline; + }); + /*if option is 'All' display all records else display specified record on page*/ $scope.UpdateRecordsToShow = () => { if($scope.RecordsToDisplay == 'All') {