HBASE-24381 The Size metrics in Master Webui is wrong if the size is 0 (#1723)

This commit is contained in:
Baiqiang Zhao 2020-05-18 09:14:36 +08:00 committed by GitHub
parent 15627bb722
commit 61efb6d5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 79 deletions

View File

@ -171,10 +171,10 @@ if (master.getServerManager() != null) {
</tr> </tr>
<%java> <%java>
final String ZEROMB = "0 MB"; final String ZEROMB = "0 MB";
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
String usedHeapStr = ZEROMB; String usedHeapStr = ZEROMB;
String maxHeapStr = ZEROMB; String maxHeapStr = ZEROMB;
String memstoreSizeStr = ZEROMB; String memstoreSizeStr = ZEROMB;
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
String rsGroupName = rsGroupInfo.getName(); String rsGroupName = rsGroupInfo.getName();
long usedHeap = 0; long usedHeap = 0;
long maxHeap = 0; long maxHeap = 0;
@ -275,11 +275,11 @@ if (master.getServerManager() != null) {
<%java> <%java>
final String ZEROKB = "0 KB"; final String ZEROKB = "0 KB";
final String ZEROMB = "0 MB"; final String ZEROMB = "0 MB";
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
String uncompressedStorefileSizeStr = ZEROMB; String uncompressedStorefileSizeStr = ZEROMB;
String storefileSizeStr = ZEROMB; String storefileSizeStr = ZEROMB;
String indexSizeStr = ZEROKB; String indexSizeStr = ZEROKB;
String bloomSizeStr = ZEROKB; String bloomSizeStr = ZEROKB;
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
String rsGroupName = rsGroupInfo.getName(); String rsGroupName = rsGroupInfo.getName();
int numStores = 0; int numStores = 0;
long numStorefiles = 0; long numStorefiles = 0;

View File

@ -162,10 +162,10 @@ Arrays.sort(serverNames);
<tbody> <tbody>
<%java> <%java>
final String ZEROMB = "0 MB"; final String ZEROMB = "0 MB";
String usedHeapStr = ZEROMB;
String maxHeapStr = ZEROMB;
String memStoreSizeMBStr = ZEROMB;
for (ServerName serverName: serverNames) { for (ServerName serverName: serverNames) {
String usedHeapStr = ZEROMB;
String maxHeapStr = ZEROMB;
String memStoreSizeMBStr = ZEROMB;
ServerMetrics sl = master.getServerManager().getLoad(serverName); ServerMetrics sl = master.getServerManager().getLoad(serverName);
if (sl != null) { if (sl != null) {
long memStoreSizeMB = 0; long memStoreSizeMB = 0;
@ -276,14 +276,14 @@ if (sl != null) {
<%java> <%java>
final String ZEROKB = "0 KB"; final String ZEROKB = "0 KB";
final String ZEROMB = "0 MB"; final String ZEROMB = "0 MB";
String storeUncompressedSizeMBStr = ZEROMB;
String storeFileSizeMBStr = ZEROMB;
String totalStaticIndexSizeKBStr = ZEROKB;
String totalStaticBloomSizeKBStr = ZEROKB;
for (ServerName serverName: serverNames) { for (ServerName serverName: serverNames) {
ServerMetrics sl = master.getServerManager().getLoad(serverName); String storeUncompressedSizeMBStr = ZEROMB;
if (sl != null) { String storeFileSizeMBStr = ZEROMB;
String totalStaticIndexSizeKBStr = ZEROKB;
String totalStaticBloomSizeKBStr = ZEROKB;
ServerMetrics sl = master.getServerManager().getLoad(serverName);
if (sl != null) {
long storeCount = 0; long storeCount = 0;
long storeFileCount = 0; long storeFileCount = 0;
long storeUncompressedSizeMB = 0; long storeUncompressedSizeMB = 0;
@ -326,7 +326,7 @@ if (sl != null) {
</tr> </tr>
<%java> <%java>
} else { } else {
</%java> </%java>
<& emptyStat; serverName=serverName; &> <& emptyStat; serverName=serverName; &>
<%java> <%java>
} }

View File

@ -213,11 +213,10 @@
<th>Memstore Size</th> <th>Memstore Size</th>
</tr> </tr>
<% <%
for (Address server: rsGroupServers) {
String usedHeapSizeMBStr = ZEROMB; String usedHeapSizeMBStr = ZEROMB;
String maxHeapSizeMBStr = ZEROMB; String maxHeapSizeMBStr = ZEROMB;
String memStoreSizeMBStr = ZEROMB; String memStoreSizeMBStr = ZEROMB;
for (Address server: rsGroupServers) {
ServerName serverName = serverMaping.get(server); ServerName serverName = serverMaping.get(server);
ServerMetrics sl = onlineServers.get(server); ServerMetrics sl = onlineServers.get(server);
if (sl != null && serverName != null) { if (sl != null && serverName != null) {
@ -309,11 +308,11 @@
<th>Bloom Size</th> <th>Bloom Size</th>
</tr> </tr>
<% <%
for (Address server: rsGroupServers) {
String storeUncompressedSizeMBStr = ZEROMB; String storeUncompressedSizeMBStr = ZEROMB;
String storeFileSizeMBStr = ZEROMB; String storeFileSizeMBStr = ZEROMB;
String totalStaticIndexSizeKBStr = ZEROKB; String totalStaticIndexSizeKBStr = ZEROKB;
String totalStaticBloomSizeKBStr = ZEROKB; String totalStaticBloomSizeKBStr = ZEROKB;
for (Address server: rsGroupServers) {
ServerName serverName = serverMaping.get(server); ServerName serverName = serverMaping.get(server);
ServerMetrics sl = onlineServers.get(server); ServerMetrics sl = onlineServers.get(server);
if (sl != null && serverName != null) { if (sl != null && serverName != null) {