Skip to content

Commit

Permalink
HDDS-11469. Statistics of Pipeline and Container (apache#7217)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghuazhu authored and sarvekshayr committed Oct 7, 2024
1 parent ce48034 commit fd301fa
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,114 @@ <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.pipelines.closed}}</td>
</tr>
<tr>
<td>Allocated</td>
<td>{{statistics.pipelines.allocated}}</td>
</tr>
<tr>
<td>Open</td>
<td>{{statistics.pipelines.open}}</td>
</tr>
<tr>
<td>Dormant</td>
<td>{{statistics.pipelines.dormant}}</td>
</tr>
</tbody>
</table>

<h2>Container Statistics</h2>
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th>Operational State</th>
<th>Size</th>
</tr>
<tr>
<td>Open</td>
<td>{{statistics.containers.lifecycle.open}}</td>
</tr>
<tr>
<td>Closing</td>
<td>{{statistics.containers.lifecycle.closing}}</td>
</tr>
<tr>
<td>Quasi Closed</td>
<td>{{statistics.containers.lifecycle.quasi_closed}}</td>
</tr>
<tr>
<td>Closed</td>
<td>{{statistics.containers.lifecycle.closed}}</td>
</tr>
<tr>
<td>Deleting</td>
<td>{{statistics.containers.lifecycle.deleting}}</td>
</tr>
<tr>
<td>Deleted</td>
<td>{{statistics.containers.lifecycle.deleted}}</td>
</tr>
<tr>
<td>Recovering</td>
<td>{{statistics.containers.lifecycle.recovering}}</td>
</tr>
</tbody>
</table>
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th>Health</th>
<th>Size</th>
</tr>
<tr>
<td>Under Replicated</td>
<td>{{statistics.containers.health.under_replicated}}</td>
</tr>
<tr>
<td>Mis Replicated</td>
<td>{{statistics.containers.health.mis_replicated}}</td>
</tr>
<tr>
<td>Over Replicated</td>
<td>{{statistics.containers.health.over_replicated}}</td>
</tr>
<tr>
<td>Missing</td>
<td>{{statistics.containers.health.missing}}</td>
</tr>
<tr>
<td>Unhealthy</td>
<td>{{statistics.containers.health.unhealthy}}</td>
</tr>
<tr>
<td>Empty</td>
<td>{{statistics.containers.health.empty}}</td>
</tr>
<tr>
<td>Open Unhealthy</td>
<td>{{statistics.containers.health.open_unhealthy}}</td>
</tr>
<tr>
<td>Quasi Closed Stuck</td>
<td>{{statistics.containers.health.quasi_closed_stuck}}</td>
</tr>
<tr>
<td>Open Without Pipeline</td>
<td>{{statistics.containers.health.open_without_pipeline}}</td>
</tr>
</tbody>
</table>

<h2>Node Status</h2>
<div class="row">
<div class="col-md-6 text-left">
Expand Down
68 changes: 68 additions & 0 deletions hadoop-hdds/server-scm/src/main/resources/webapps/scm/scm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit fd301fa

Please sign in to comment.