HDFS-7483. Display information per tier on the Namenode UI. Contributed by Benoy Antony and Haohui Mai.

This commit is contained in:
Haohui Mai 2015-07-20 20:10:53 -07:00
parent e78ee18642
commit 4283831348
4 changed files with 36 additions and 1 deletions

View File

@ -388,6 +388,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8794. Improve CorruptReplicasMap#corruptReplicasMap. (yliu)
HDFS-7483. Display information per tier on the Namenode UI.
(Benoy Antony and wheat9 via wheat9)
OPTIMIZATIONS
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

View File

@ -199,6 +199,31 @@
{#failed}{#helper_dir_status type="Failed"/}{/failed}
{/nn.NameDirStatuses}
</table>
<div class="page-header"><h1>DFS Storage Types</h1></div>
<small>
<table class="table">
<thead>
<tr>
<th>Storage Type</th>
<th>Configured Capacity</th>
<th>Capacity Used</th>
<th>Capacity Remaining</th>
<th>Block Pool Used</th>
<th>Nodes In Service</th>
</tr>
</thead>
{#blockstats.StorageTypeStats}
<tr>
<td>{key}</td>
<td>{value.capacityTotal|fmt_bytes}</td>
<td>{value.capacityUsed|fmt_bytes} ({value.capacityUsedPercentage|fmt_percentage})</td>
<td>{value.capacityRemaining|fmt_bytes} ({value.capacityRemainingPercentage|fmt_percentage})</td>
<td>{value.blockPoolUsed|fmt_bytes}</td>
<td>{value.nodesInService}</td>
</tr>
{/blockstats.StorageTypeStats}
</table>
</small>
</script>
<script type="text/x-dust-template" id="tmpl-snapshot">

View File

@ -29,6 +29,7 @@
{"name": "nn", "url": "/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo"},
{"name": "nnstat", "url": "/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus"},
{"name": "fs", "url": "/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState"},
{"name": "blockstats", "url": "/jmx?qry=Hadoop:service=NameNode,name=BlockStats"},
{"name": "mem", "url": "/jmx?qry=java.lang:type=Memory"}
];
@ -88,6 +89,13 @@
for (var k in d) {
data[k] = k === 'nn' ? workaround(d[k].beans[0]) : d[k].beans[0];
}
var blockstats = data['blockstats'];
for (var k in blockstats.StorageTypeStats) {
var b = blockstats.StorageTypeStats[k].value;
b.capacityUsedPercentage = b.capacityUsed * 100.0 / b.capacityTotal;
b.capacityRemainingPercentage = b.capacityRemaining * 100.0 / b.capacityTotal;
}
render();
}),
function (url, jqxhr, text, err) {

View File

@ -106,7 +106,6 @@ public class TestBlockStatsMXBean {
public void testStorageTypeStatsJMX() throws Exception {
URL baseUrl = new URL (cluster.getHttpUri(0));
String result = readOutput(new URL(baseUrl, "/jmx"));
System.out.println(result);
Map<String, Object> stat = (Map<String, Object>) JSON.parse(result);
Object[] beans =(Object[]) stat.get("beans");