HBASE-16657 Expose per-region last major compaction time in RegionServer UI

Signed-off-by: Gary Helmling <garyh@apache.org>
This commit is contained in:
Dustin Pho 2016-09-24 17:53:55 -07:00 committed by Gary Helmling
parent 7092dc3ec4
commit fa98c506d0
1 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,7 @@
</%args>
<%import>
java.util.*;
org.apache.commons.lang.time.FastDateFormat;
org.apache.hadoop.hbase.regionserver.HRegionServer;
org.apache.hadoop.hbase.util.Bytes;
org.apache.hadoop.hbase.HRegionInfo;
@ -191,6 +192,7 @@
<th>Num. Compacting KVs</th>
<th>Num. Compacted KVs</th>
<th>Compaction Progress</th>
<th>Last Major Compaction</th>
</tr>
<%for HRegionInfo r: onlineRegions %>
@ -203,6 +205,12 @@
percentDone = String.format("%.2f", 100 *
((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%";
}
long lastMajorCompactionTs = load.getLastMajorCompactionTs();
String compactTime = "";
if (lastMajorCompactionTs > 0) {
FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd HH:mm ZZ");
compactTime = fdf.format(lastMajorCompactionTs);
}
</%java>
<td><a href="region.jsp?name=<% r.getEncodedName() %>">
<% r.getRegionNameAsString() %></a>
@ -211,6 +219,7 @@
<td><% load.getTotalCompactingKVs() %></td>
<td><% load.getCurrentCompactedKVs() %></td>
<td><% percentDone %></td>
<td><% compactTime %></td>
</%if>
</tr>
</%for>