HBASE-18789 Displays the reporting interval of each RS on the Master page

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Guangxu Cheng 2017-09-13 23:37:19 +08:00 committed by tedyu
parent 432ca7e3fb
commit a8ac84f1a6
2 changed files with 11 additions and 0 deletions

View File

@ -55,9 +55,11 @@ public class ServerLoad {
private int totalStaticBloomSizeKB = 0;
private long totalCompactingKVs = 0;
private long currentCompactedKVs = 0;
private long reportTime = 0;
public ServerLoad(ClusterStatusProtos.ServerLoad serverLoad) {
this.serverLoad = serverLoad;
this.reportTime = System.currentTimeMillis();
for (ClusterStatusProtos.RegionLoad rl: serverLoad.getRegionLoadsList()) {
stores += rl.getStores();
storefiles += rl.getStorefiles();
@ -323,4 +325,8 @@ public class ServerLoad {
public static final ServerLoad EMPTY_SERVERLOAD =
new ServerLoad(ClusterStatusProtos.ServerLoad.newBuilder().build());
public long getReportTime() {
return reportTime;
}
}

View File

@ -81,6 +81,7 @@ Arrays.sort(serverNames);
<tr>
<th>ServerName</th>
<th>Start time</th>
<th>Last contact</th>
<th>Version</th>
<th>Requests Per Second</th>
<th>Num. Regions</th>
@ -100,6 +101,7 @@ Arrays.sort(serverNames);
double requestsPerSecond = 0.0;
int numRegionsOnline = 0;
long lastContact = 0;
if (sl != null) {
requestsPerSecond = sl.getRequestsPerSecond();
@ -107,12 +109,14 @@ Arrays.sort(serverNames);
totalRegions += sl.getNumberOfRegions();
// Is this correct? Adding a rate to a measure.
totalRequests += sl.getNumberOfRequests();
lastContact = (System.currentTimeMillis() - sl.getReportTime())/1000;
}
long startcode = serverName.getStartcode();
</%java>
<tr>
<td><& serverNameLink; serverName=serverName; serverLoad = sl; &></td>
<td><% new Date(startcode) %></td>
<td><% TraditionalBinaryPrefix.long2String(lastContact, "s", 1) %></td>
<td><% version %></td>
<td><% String.format("%.0f", requestsPerSecond) %></td>
<td><% numRegionsOnline %></td>
@ -122,6 +126,7 @@ Arrays.sort(serverNames);
</%java>
<tr><td>Total:<% servers.size() %></td>
<td></td>
<td></td>
<%if inconsistentNodeNum > 0%>
<td style="color:red;"><% inconsistentNodeNum %> nodes with inconsistent version</td>
<%else>