hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-18789 Displays the reporting interval of each RS on the Master page
Date Wed, 13 Sep 2017 16:39:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 b6aa23eef -> 33b30811a


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

Signed-off-by: tedyu <yuzhihong@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/33b30811
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/33b30811
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/33b30811

Branch: refs/heads/branch-1.4
Commit: 33b30811a547a7e04dc0a2cbe9969e4c3eb81281
Parents: b6aa23e
Author: Guangxu Cheng <guangxucheng@gmail.com>
Authored: Wed Sep 13 23:37:19 2017 +0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Sep 13 09:39:51 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/ServerLoad.java      | 6 ++++++
 .../apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon | 5 +++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/33b30811/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
index 3d502c0..ddca47a 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java
@@ -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;
+  }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/33b30811/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
index cde757f..451cfa4 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon
@@ -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>


Mime
View raw message