diff --git a/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp b/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp index 73630317600e..c9ed0f43d851 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp @@ -35,12 +35,6 @@ ObjectName jvmMetrics = new ObjectName("Hadoop:service=HBase,name=JvmMetrics"); // There is always two of GC collectors List gcBeans = JSONMetricUtil.getGcCollectorBeans(); -GarbageCollectorMXBean collector1 = null; -GarbageCollectorMXBean collector2 = null; -try { -collector1 = gcBeans.get(0); -collector2 = gcBeans.get(1); -} catch(IndexOutOfBoundsException e) {} List mPools = JSONMetricUtil.getMemoryPools(); pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID()); %> @@ -79,10 +73,10 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - + - + @@ -100,19 +94,21 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - - <% if (gcBeans.size() == 2) { %> + + <% if (gcBeans != null && !gcBeans.isEmpty()) { %>
-
+ <% idx = 0; long totalGcTime = 0; for (GarbageCollectorMXBean gc : gcBeans) { totalGcTime += gc.getCollectionTime(); %> +
" id="tab_gc_<%= idx %>" role="tabpanel">
ThreadsNewThreadsRunableThreadsRunnable ThreadsBlocked ThreadsWaitingThreadsTimeWaitingThreadsTimedWaiting ThreadsTerminated
@@ -120,35 +116,20 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - - - + + +
Collection CountLast duration
<%= collector1.getCollectionCount() %> <%= StringUtils.humanTimeDiff(collector1.getCollectionTime()) %> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( - collector1.getObjectName())) %><%= gc.getCollectionCount() %><%= StringUtils.humanTimeDiff(gc.getCollectionTime()) %><%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( + gc.getObjectName())) %>
-
- - - - - - - - - - - -
Collection CountCollection TimeLast duration
<%= collector2.getCollectionCount() %> <%= StringUtils.humanTimeDiff(collector2.getCollectionTime()) %> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( - collector2.getObjectName())) %>
-
+ <% idx++; } %> - <%} else { %> -

Can not display GC Collector stats.

- <%} %> - Total GC Collection time: <%= StringUtils.humanTimeDiff(collector1.getCollectionTime() + - collector2.getCollectionTime())%> +

Total GC Collection time: <%= StringUtils.humanTimeDiff(totalGcTime) %>

+ <% } else { %> +

Can not display GC Collector stats.

+ <% } %> <% for(MemoryPoolMXBean mp:mPools) { if(mp.getName().contains("Cache")) continue;%> diff --git a/hbase-server/src/main/resources/hbase-webapps/regionserver/processRS.jsp b/hbase-server/src/main/resources/hbase-webapps/regionserver/processRS.jsp index 9261de13f45b..b1e1fe359ca5 100644 --- a/hbase-server/src/main/resources/hbase-webapps/regionserver/processRS.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/processRS.jsp @@ -38,12 +38,6 @@ Object pauseInfoThresholdExceeded = JSONMetricUtil.getValueFromMBean(rsMetrics, // There is always two of GC collectors List gcBeans = JSONMetricUtil.getGcCollectorBeans(); -GarbageCollectorMXBean collector1 = null; -GarbageCollectorMXBean collector2 = null; -try { -collector1 = gcBeans.get(0); -collector2 = gcBeans.get(1); -} catch(IndexOutOfBoundsException e) {} List mPools = JSONMetricUtil.getMemoryPools(); pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID()); %> @@ -85,10 +79,10 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - + - + @@ -107,19 +101,21 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - - <% if (gcBeans.size() == 2) { %> + + <% if (gcBeans != null && !gcBeans.isEmpty()) { %>
-
+ <% idx = 0; long totalGcTime = 0; for (GarbageCollectorMXBean gc : gcBeans) { totalGcTime += gc.getCollectionTime(); %> +
" id="tab_gc_<%= idx %>" role="tabpanel">
ThreadsNewThreadsRunableThreadsRunnable ThreadsBlocked ThreadsWaitingThreadsTimeWaitingThreadsTimedWaiting ThreadsTerminated
@@ -127,35 +123,20 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil. - - - + + +
Collection CountLast duration
<%= collector1.getCollectionCount() %> <%= StringUtils.humanTimeDiff(collector1.getCollectionTime()) %> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( - collector1.getObjectName())) %><%= gc.getCollectionCount() %><%= StringUtils.humanTimeDiff(gc.getCollectionTime()) %><%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( + gc.getObjectName())) %>
-
- - - - - - - - - - - -
Collection CountCollection TimeLast duration
<%= collector2.getCollectionCount() %> <%= StringUtils.humanTimeDiff(collector2.getCollectionTime()) %> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration( - collector2.getObjectName())) %>
+ <% idx++; } %>
- - - <%} else { %> -

Can not display GC Collector stats.

- <%} %> - Total GC Collection time: <%= StringUtils.humanTimeDiff(collector1.getCollectionTime() + - collector2.getCollectionTime())%> + +

Total GC Collection time: <%= StringUtils.humanTimeDiff(totalGcTime) %>

+ <% } else { %> +

Can not display GC Collector stats.

+ <% } %> <% for(MemoryPoolMXBean mp:mPools) { if(mp.getName().contains("Cache")) continue;%>