Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ ObjectName jvmMetrics = new ObjectName("Hadoop:service=HBase,name=JvmMetrics");

// There is always two of GC collectors
List<GarbageCollectorMXBean> gcBeans = JSONMetricUtil.getGcCollectorBeans();
GarbageCollectorMXBean collector1 = null;
GarbageCollectorMXBean collector2 = null;
try {
collector1 = gcBeans.get(0);
collector2 = gcBeans.get(1);
} catch(IndexOutOfBoundsException e) {}
List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID());
%>
Expand Down Expand Up @@ -79,10 +73,10 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.
<table class="table table-striped" width="90%" >
<tr>
<th>ThreadsNew</th>
<th>ThreadsRunable</th>
<th>ThreadsRunnable</th>
<th>ThreadsBlocked</th>
<th>ThreadsWaiting</th>
<th>ThreadsTimeWaiting</th>
<th>ThreadsTimedWaiting</th>
<th>ThreadsTerminated</th>
</tr>
<tr>
Expand All @@ -100,55 +94,42 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.
<div class="page-header">
<h2>GC Collectors</h2>
</div>
</div>
<% if (gcBeans.size() == 2) { %>
</div>
<% if (gcBeans != null && !gcBeans.isEmpty()) { %>
<div class="tabbable">
<ul class="nav nav-pills" role="tablist">
<% int idx = 0; for (GarbageCollectorMXBean gc : gcBeans) { %>
<li class="nav-item">
<a class="nav-link active" href="#tab_gc1" data-bs-toggle="tab" role="tab"><%=collector1.getName() %></a>
<a class="nav-link <%= idx == 0 ? "active" : "" %>" href="#tab_gc_<%= idx %>" data-bs-toggle="tab" role="tab">
<%= gc.getName() %>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab_gc2" data-bs-toggle="tab" role="tab"><%=collector2.getName() %></a>
</li>
<% idx++; } %>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_gc1" role="tabpanel">
<% idx = 0; long totalGcTime = 0; for (GarbageCollectorMXBean gc : gcBeans) { totalGcTime += gc.getCollectionTime(); %>
<div class="tab-pane <%= idx == 0 ? "active" : "" %>" id="tab_gc_<%= idx %>" role="tabpanel">
<table class="table table-striped">
<tr>
<th>Collection Count</th>
<th>Collection Time</th>
<th>Last duration</th>
</tr>
<tr>
<td> <%= collector1.getCollectionCount() %></td>
<td> <%= StringUtils.humanTimeDiff(collector1.getCollectionTime()) %> </td>
<td> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector1.getObjectName())) %></td>
<td><%= gc.getCollectionCount() %></td>
<td><%= StringUtils.humanTimeDiff(gc.getCollectionTime()) %></td>
<td><%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
gc.getObjectName())) %></td>
</tr>
</table>
</div>
<div class="tab-pane" id="tab_gc2" role="tabpanel">
<table class="table table-striped">
<tr>
<th>Collection Count</th>
<th>Collection Time</th>
<th>Last duration</th>
</tr>
<tr>
<td> <%= collector2.getCollectionCount() %></td>
<td> <%= StringUtils.humanTimeDiff(collector2.getCollectionTime()) %> </td>
<td> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector2.getObjectName())) %></td>
</tr>
</table>
</div>
<% idx++; } %>
</div>
</div>
<%} else { %>
<p> Can not display GC Collector stats.</p>
<%} %>
Total GC Collection time: <%= StringUtils.humanTimeDiff(collector1.getCollectionTime() +
collector2.getCollectionTime())%>
<p>Total GC Collection time: <%= StringUtils.humanTimeDiff(totalGcTime) %></p>
<% } else { %>
<p>Can not display GC Collector stats.</p>
<% } %>
</div>
<% for(MemoryPoolMXBean mp:mPools) {
if(mp.getName().contains("Cache")) continue;%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ Object pauseInfoThresholdExceeded = JSONMetricUtil.getValueFromMBean(rsMetrics,

// There is always two of GC collectors
List<GarbageCollectorMXBean> gcBeans = JSONMetricUtil.getGcCollectorBeans();
GarbageCollectorMXBean collector1 = null;
GarbageCollectorMXBean collector2 = null;
try {
collector1 = gcBeans.get(0);
collector2 = gcBeans.get(1);
} catch(IndexOutOfBoundsException e) {}
List<MemoryPoolMXBean> mPools = JSONMetricUtil.getMemoryPools();
pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.getProcessPID());
%>
Expand Down Expand Up @@ -85,10 +79,10 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.
<table class="table table-striped" width="90%" >
<tr>
<th>ThreadsNew</th>
<th>ThreadsRunable</th>
<th>ThreadsRunnable</th>
<th>ThreadsBlocked</th>
<th>ThreadsWaiting</th>
<th>ThreadsTimeWaiting</th>
<th>ThreadsTimedWaiting</th>
<th>ThreadsTerminated</th>
</tr>
<tr>
Expand All @@ -107,55 +101,42 @@ pageContext.setAttribute("pageTitle", "Process info for PID: " + JSONMetricUtil.
<div class="page-header">
<h2>GC Collectors</h2>
</div>
</div>
<% if (gcBeans.size() == 2) { %>
</div>
<% if (gcBeans != null && !gcBeans.isEmpty()) { %>
<div class="tabbable">
<ul class="nav nav-pills" role="tablist">
<% int idx = 0; for (GarbageCollectorMXBean gc : gcBeans) { %>
<li class="nav-item">
<a class="nav-link active" href="#tab_gc1" data-bs-toggle="tab" role="tab"><%=collector1.getName() %></a>
<a class="nav-link <%= idx == 0 ? "active" : "" %>" href="#tab_gc_<%= idx %>" data-bs-toggle="tab" role="tab">
<%= gc.getName() %>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab_gc2" data-bs-toggle="tab" role="tab"><%=collector2.getName() %></a>
</li>
<% idx++; } %>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_gc1" role="tabpanel">
<% idx = 0; long totalGcTime = 0; for (GarbageCollectorMXBean gc : gcBeans) { totalGcTime += gc.getCollectionTime(); %>
<div class="tab-pane <%= idx == 0 ? "active" : "" %>" id="tab_gc_<%= idx %>" role="tabpanel">
<table class="table table-striped">
<tr>
<th>Collection Count</th>
<th>Collection Time</th>
<th>Last duration</th>
</tr>
<tr>
<td> <%= collector1.getCollectionCount() %></td>
<td> <%= StringUtils.humanTimeDiff(collector1.getCollectionTime()) %> </td>
<td> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector1.getObjectName())) %></td>
<td><%= gc.getCollectionCount() %></td>
<td><%= StringUtils.humanTimeDiff(gc.getCollectionTime()) %></td>
<td><%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
gc.getObjectName())) %></td>
</tr>
</table>
</div>
<div class="tab-pane" id="tab_gc2" role="tabpanel">
<table class="table table-striped">
<tr>
<th>Collection Count</th>
<th>Collection Time</th>
<th>Last duration</th>
</tr>
<tr>
<td> <%= collector2.getCollectionCount() %></td>
<td> <%= StringUtils.humanTimeDiff(collector2.getCollectionTime()) %> </td>
<td> <%= StringUtils.humanTimeDiff(JSONMetricUtil.getLastGcDuration(
collector2.getObjectName())) %></td>
</tr>
</table>
<% idx++; } %>
</div>
</div>
</div>
<%} else { %>
<p> Can not display GC Collector stats.</p>
<%} %>
Total GC Collection time: <%= StringUtils.humanTimeDiff(collector1.getCollectionTime() +
collector2.getCollectionTime())%>
</div>
<p>Total GC Collection time: <%= StringUtils.humanTimeDiff(totalGcTime) %></p>
<% } else { %>
<p>Can not display GC Collector stats.</p>
<% } %>
</div>
<% for(MemoryPoolMXBean mp:mPools) {
if(mp.getName().contains("Cache")) continue;%>
Expand Down
Loading