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:
parent
d576e5a32d
commit
5370aed410
|
@ -54,10 +54,12 @@ public class ServerLoad {
|
||||||
private int totalStaticBloomSizeKB = 0;
|
private int totalStaticBloomSizeKB = 0;
|
||||||
private long totalCompactingKVs = 0;
|
private long totalCompactingKVs = 0;
|
||||||
private long currentCompactedKVs = 0;
|
private long currentCompactedKVs = 0;
|
||||||
|
private long reportTime = 0;
|
||||||
|
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
public ServerLoad(ClusterStatusProtos.ServerLoad serverLoad) {
|
public ServerLoad(ClusterStatusProtos.ServerLoad serverLoad) {
|
||||||
this.serverLoad = serverLoad;
|
this.serverLoad = serverLoad;
|
||||||
|
this.reportTime = System.currentTimeMillis();
|
||||||
for (ClusterStatusProtos.RegionLoad rl: serverLoad.getRegionLoadsList()) {
|
for (ClusterStatusProtos.RegionLoad rl: serverLoad.getRegionLoadsList()) {
|
||||||
stores += rl.getStores();
|
stores += rl.getStores();
|
||||||
storefiles += rl.getStorefiles();
|
storefiles += rl.getStorefiles();
|
||||||
|
@ -74,7 +76,6 @@ public class ServerLoad {
|
||||||
totalCompactingKVs += rl.getTotalCompactingKVs();
|
totalCompactingKVs += rl.getTotalCompactingKVs();
|
||||||
currentCompactedKVs += rl.getCurrentCompactedKVs();
|
currentCompactedKVs += rl.getCurrentCompactedKVs();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: Function name cannot start with "get" because then an OpenDataException is thrown because
|
// NOTE: Function name cannot start with "get" because then an OpenDataException is thrown because
|
||||||
|
@ -359,4 +360,8 @@ public class ServerLoad {
|
||||||
|
|
||||||
public static final ServerLoad EMPTY_SERVERLOAD =
|
public static final ServerLoad EMPTY_SERVERLOAD =
|
||||||
new ServerLoad(ClusterStatusProtos.ServerLoad.newBuilder().build());
|
new ServerLoad(ClusterStatusProtos.ServerLoad.newBuilder().build());
|
||||||
|
|
||||||
|
public long getReportTime() {
|
||||||
|
return reportTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,7 @@ Arrays.sort(serverNames);
|
||||||
<tr>
|
<tr>
|
||||||
<th>ServerName</th>
|
<th>ServerName</th>
|
||||||
<th>Start time</th>
|
<th>Start time</th>
|
||||||
|
<th>Last contact</th>
|
||||||
<th>Version</th>
|
<th>Version</th>
|
||||||
<th>Requests Per Second</th>
|
<th>Requests Per Second</th>
|
||||||
<th>Num. Regions</th>
|
<th>Num. Regions</th>
|
||||||
|
@ -96,6 +97,7 @@ Arrays.sort(serverNames);
|
||||||
|
|
||||||
double requestsPerSecond = 0.0;
|
double requestsPerSecond = 0.0;
|
||||||
int numRegionsOnline = 0;
|
int numRegionsOnline = 0;
|
||||||
|
long lastContact = 0;
|
||||||
|
|
||||||
if (sl != null) {
|
if (sl != null) {
|
||||||
requestsPerSecond = sl.getRequestsPerSecond();
|
requestsPerSecond = sl.getRequestsPerSecond();
|
||||||
|
@ -103,12 +105,14 @@ Arrays.sort(serverNames);
|
||||||
totalRegions += sl.getNumberOfRegions();
|
totalRegions += sl.getNumberOfRegions();
|
||||||
// Is this correct? Adding a rate to a measure.
|
// Is this correct? Adding a rate to a measure.
|
||||||
totalRequests += sl.getNumberOfRequests();
|
totalRequests += sl.getNumberOfRequests();
|
||||||
|
lastContact = (System.currentTimeMillis() - sl.getReportTime())/1000;
|
||||||
}
|
}
|
||||||
long startcode = serverName.getStartcode();
|
long startcode = serverName.getStartcode();
|
||||||
</%java>
|
</%java>
|
||||||
<tr>
|
<tr>
|
||||||
<td><& serverNameLink; serverName=serverName; serverLoad = sl; &></td>
|
<td><& serverNameLink; serverName=serverName; serverLoad = sl; &></td>
|
||||||
<td><% new Date(startcode) %></td>
|
<td><% new Date(startcode) %></td>
|
||||||
|
<td><% TraditionalBinaryPrefix.long2String(lastContact, "s", 1) %></td>
|
||||||
<td><% version %></td>
|
<td><% version %></td>
|
||||||
<td><% String.format("%.0f", requestsPerSecond) %></td>
|
<td><% String.format("%.0f", requestsPerSecond) %></td>
|
||||||
<td><% numRegionsOnline %></td>
|
<td><% numRegionsOnline %></td>
|
||||||
|
@ -118,6 +122,7 @@ Arrays.sort(serverNames);
|
||||||
</%java>
|
</%java>
|
||||||
<tr><td>Total:<% servers.size() %></td>
|
<tr><td>Total:<% servers.size() %></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
<%if inconsistentNodeNum > 0%>
|
<%if inconsistentNodeNum > 0%>
|
||||||
<td style="color:red;"><% inconsistentNodeNum %> nodes with inconsistent version</td>
|
<td style="color:red;"><% inconsistentNodeNum %> nodes with inconsistent version</td>
|
||||||
<%else>
|
<%else>
|
||||||
|
|
Loading…
Reference in New Issue