You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2019/06/05 02:09:07 UTC

[hbase] branch branch-2.1 updated: HBASE-22160 Add sorting functionality in regionserver web UI for user

This is an automated email from the ASF dual-hosted git repository.

brfrn169 pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 5b3c954  HBASE-22160 Add sorting functionality in regionserver web UI for user
5b3c954 is described below

commit 5b3c954498a0514a8846abef2b5e24791b31f3b3
Author: Daisuke Kobayashi <po...@gmail.com>
AuthorDate: Thu May 30 01:02:16 2019 -0700

    HBASE-22160 Add sorting functionality in regionserver web UI for user
    
    Signed-off-by: Toshihiro Suzuki <br...@gmail.com>
    Signed-off-by: Wellington Chevreuil <we...@gmail.com>
---
 .../hbase/tmpl/regionserver/RSStatusTmpl.jamon     | 35 ++++++++++++++++++++++
 .../hbase/tmpl/regionserver/RegionListTmpl.jamon   | 34 ++++++++++++++++-----
 2 files changed, 62 insertions(+), 7 deletions(-)

diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
index 116eda3..2d1e5ed 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon
@@ -210,7 +210,42 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
     </div>
 </div>
 <script src="/static/js/jquery.min.js" type="text/javascript"></script>
+<script src="/static/js/jquery.tablesorter.min.js" type="text/javascript"></script>
 <script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
 <script src="/static/js/tab.js" type="text/javascript"></script>
+<script>
+$(document).ready(function()
+    {
+        $.tablesorter.addParser({
+            id: 'filesize',
+            is: function(s) {
+                return s.match(new RegExp( /([\.0-9]+)\ (B|KB|MB|GB|TB)/ ));
+            },
+            format: function(s) {
+                var suf = s.match(new RegExp( /(KB|B|GB|MB|TB)$/ ))[1];
+                var num = parseFloat(s.match( new RegExp( /([\.0-9]+)\ (B|KB|MB|GB|TB)/ ))[0]);
+                switch(suf) {
+                    case 'B':
+                        return num;
+                    case 'KB':
+                        return num * 1024;
+                    case 'MB':
+                        return num * 1024 * 1024;
+                    case 'GB':
+                        return num * 1024 * 1024 * 1024;
+                    case 'TB':
+                        return num * 1024 * 1024 * 1024 * 1024;
+                }
+            },
+            type: 'numeric'
+        });
+        $("#baseStatsTable").tablesorter();
+        $("#requestStatsTable").tablesorter();
+        $("#storeStatsTable").tablesorter();
+        $("#compactionStatsTable").tablesorter();
+        $("#memstoreStatsTable").tablesorter();
+    }
+);
+</script>
 </body>
 </html>
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
index 6a01533..7e983f5 100644
--- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
+++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon
@@ -88,14 +88,17 @@
 <%args>
     List<RegionInfo> onlineRegions;
 </%args>
-    <table class="table table-striped">
+    <table id="baseStatsTable" class="tablesorter table table-striped">
+    <thead>
         <tr>
             <th>Region Name</th>
             <th>Start Key</th>
             <th>End Key</th>
             <th>ReplicaID</th>
         </tr>
+    </thead>
 
+    <tbody>
         <%for RegionInfo r: onlineRegions %>
         <tr>
             <%java>
@@ -110,6 +113,7 @@
             <td><% r.getReplicaId() %></td>
         </tr>
         </%for>
+    </tbody>
     </table>
 </%def>
 
@@ -117,14 +121,17 @@
 <%args>
     List<RegionInfo> onlineRegions;
 </%args>
-    <table class="table table-striped">
+    <table id="requestStatsTable" class="tablesorter table table-striped">
+    <thead>
         <tr>
             <th>Region Name</th>
             <th>Read Request Count</th>
             <th>Filtered Read Request Count</th>
             <th>Write Request Count</th>
         </tr>
+    </thead>
 
+    <tbody>
         <%for RegionInfo r: onlineRegions %>
 
         <tr>
@@ -141,6 +148,7 @@
             </%if>
         </tr>
         </%for>
+    </tbody>
     </table>
 </%def>
 
@@ -149,7 +157,8 @@
 <%args>
     List<RegionInfo> onlineRegions;
 </%args>
-    <table class="table table-striped">
+    <table id="storeStatsTable" class="tablesorter table table-striped">
+    <thead>
         <tr>
             <th>Region Name</th>
             <th>Num. Stores</th>
@@ -160,7 +169,9 @@
             <th>Bloom Size</th>
             <th>Data Locality</th>
         </tr>
+    </thead>
 
+    <tbody>
         <%for RegionInfo r: onlineRegions %>
 
         <tr>
@@ -185,6 +196,7 @@
             </%if>
         </tr>
         </%for>
+    </tbody>
     </table>
 </%def>
 
@@ -193,15 +205,18 @@
 <%args>
     List<RegionInfo> onlineRegions;
 </%args>
-    <table class="table table-striped">
+    <table id="compactionStatsTable" class="tablesorter table table-striped">
+    <thead>
         <tr>
             <th>Region Name</th>
             <th>Num. Compacting Cells</th>
             <th>Num. Compacted Cells</th>
             <th>Compaction Progress</th>
-            <th>Last Major Compaction</th>
+            <th data-date-format="yyyymmdd hhmm zz">Last Major Compaction</th>
         </tr>
+    </thead>
 
+    <tbody>
         <%for RegionInfo r: onlineRegions %>
 
         <tr>
@@ -215,7 +230,7 @@
                     ((float) load.getCurrentCompactedKVs() / load.getTotalCompactingKVs())) + "%";
               }
               if (load.getLastMajorCompactionTs() > 0) {
-                FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd HH:mm ZZ");
+                FastDateFormat fdf = FastDateFormat.getInstance("yyyy-MM-dd HH:mm (ZZ)");
                 compactTime = fdf.format(load.getLastMajorCompactionTs());
               }
             }
@@ -231,6 +246,7 @@
             </%if>
         </tr>
         </%for>
+    </tbody>
     </table>
 </%def>
 
@@ -238,12 +254,15 @@
 <%args>
     List<RegionInfo> onlineRegions;
 </%args>
-    <table class="table table-striped">
+    <table id="memstoreStatsTable" class="tablesorter table table-striped">
+    <thead>
         <tr>
             <th>Region Name</th>
             <th>Memstore Size</th>
         </tr>
+    </thead>
 
+    <tbody>
         <%for RegionInfo r: onlineRegions %>
 
         <tr>
@@ -259,5 +278,6 @@
             </%if>
         </tr>
         </%for>
+    </tbody>
     </table>
 </%def>