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

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


The following commit(s) were added to refs/heads/branch-2 by this push:
     new c707a9f  HBASE-25914 Provide slow/large logs on RegionServer UI (#3321)
c707a9f is described below

commit c707a9ffff3310cc7f30a94f85de83b69f0fe438
Author: GeorryHuang <[email protected]>
AuthorDate: Sun Jun 27 22:27:06 2021 +0800

    HBASE-25914 Provide slow/large logs on RegionServer UI (#3321)
    
    Signed-off-by: Duo Zhang <[email protected]>
---
 .../hbase/tmpl/master/MasterStatusTmpl.jamon       |   2 +-
 .../hbase/tmpl/regionserver/RSStatusTmpl.jamon     |   1 +
 .../main/resources/hbase-webapps/master/header.jsp |   2 +-
 .../{namedQueueLog.jsp => operationDetails.jsp}    |  10 +-
 .../hbase-webapps/regionserver/header.jsp          |   1 +
 .../regionserver/rsOperationDetails.jsp            | 176 +++++++++++++++++++++
 6 files changed, 185 insertions(+), 7 deletions(-)

diff --git 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
index a61fb71..57227b2 100644
--- 
a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
+++ 
b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon
@@ -153,7 +153,7 @@ AssignmentManager assignmentManager = 
master.getAssignmentManager();
                 <%if master.isActiveMaster() %>
                     <li><a href="/procedures.jsp">Procedures &amp; 
Locks</a></li>
                     <li><a href="/hbck.jsp">HBCK Report</a></li>
-                    <li><a href="/namedQueueLog.jsp">Named Queue Logs</a></li>
+                    <li><a href="/operationDetails.jsp">Operation 
Details</a></li>
                     <%if 
master.getConfiguration().getBoolean(QuotaUtil.QUOTA_CONF_KEY, false) %>
                         <li><a href="/quotas.jsp">Quotas</a></li>
                     </%if>
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 388357d..2068c76 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
@@ -111,6 +111,7 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
                 <li class="active"><a href="/rs-status">Home</a></li>
                 <li><a href="/processRS.jsp">Process Metrics</a></li>
                 <li><a href="/logs/">Local Logs</a></li>
+                <li><a href="/rsOperationDetails.jsp">Operation 
Details</a></li>
                 <li><a href="/logLevel">Log Level</a></li>
                 <li><a href="/dump">Debug Dump</a></li>
                 <li><a href="/jmx">Metrics Dump</a></li>
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/header.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/header.jsp
index f5069c3..3da82c9 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/header.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/header.jsp
@@ -60,7 +60,7 @@
             <% if (master.isActiveMaster()){ %>
               <li><a href="/procedures.jsp">Procedures &amp; Locks</a></li>
               <li><a href="/hbck.jsp">HBCK Report</a></li>
-              <li><a href="/namedQueueLog.jsp">Named Queue Logs</a></li>
+              <li><a href="/operationDetails.jsp">Operation Details</a></li>
               <% if 
(master.getConfiguration().getBoolean(QuotaUtil.QUOTA_CONF_KEY, false)) { %>
                 <li><a href="/quotas.jsp">Quotas</a></li>
               <% }%>
diff --git 
a/hbase-server/src/main/resources/hbase-webapps/master/namedQueueLog.jsp 
b/hbase-server/src/main/resources/hbase-webapps/master/operationDetails.jsp
similarity index 91%
rename from 
hbase-server/src/main/resources/hbase-webapps/master/namedQueueLog.jsp
rename to 
hbase-server/src/main/resources/hbase-webapps/master/operationDetails.jsp
index dc1e599..e604955 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/namedQueueLog.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/operationDetails.jsp
@@ -22,12 +22,8 @@
   import="java.util.List"
   import="org.apache.hadoop.conf.Configuration"
   import="org.apache.hadoop.hbase.client.Admin"
-  import="org.apache.hadoop.hbase.client.SnapshotDescription"
-  import="org.apache.hadoop.hbase.http.InfoServer"
   import="org.apache.hadoop.hbase.master.HMaster"
-  import="org.apache.hadoop.hbase.snapshot.SnapshotInfo"
   import="org.apache.hadoop.util.StringUtils"
-  import="org.apache.hadoop.hbase.TableName"
   import="org.apache.hadoop.hbase.client.ServerType"
   import="org.apache.hadoop.hbase.client.LogEntry"
   import="org.apache.hadoop.hbase.client.BalancerRejection"
@@ -55,7 +51,9 @@
 <div class="container-fluid content">
   <div class="row">
     <div class="page-header">
-    <h2>Named Queues</h2>
+    <h2>Operations Details</h2>
+    <p>HBase uses some fixed-size ring buffers to maintain rolling window 
history of specific server-side operation details.
+    This page list all operation details retrieve from these ring buffers</p>
     </div>
     </div>
 <div class="tabbable">
@@ -69,6 +67,7 @@
   </ul>
     <div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px 
solid #ddd;">
       <div class="tab-pane active" id="tab_named_queue1">
+      <p>Balancer Rejection explain why balancer is skipping runs and explain 
all factors considered</p>
         <table class="table table-striped">
           <tr>
             <th>Reason</th>
@@ -95,6 +94,7 @@
           </table>
       </div>
       <div class="tab-pane" id="tab_named_queue2">
+      <p>Balancer Decision displayed the history of decision(factor details 
and weights and costs) made by LoadBalancers</p>
           <table class="table table-striped">
             <tr>
               <th>Initial Function Costs</th>
diff --git 
a/hbase-server/src/main/resources/hbase-webapps/regionserver/header.jsp 
b/hbase-server/src/main/resources/hbase-webapps/regionserver/header.jsp
index 88ca515..edbecc4 100644
--- a/hbase-server/src/main/resources/hbase-webapps/regionserver/header.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/regionserver/header.jsp
@@ -53,6 +53,7 @@
             <li><a href="/rs-status">Home</a></li>
             <li><a href="/processRS.jsp">Process Metrics</a></li>
             <li><a href="/logs/">Local Logs</a></li>
+            <li><a href="/rsOperationDetails.jsp">Operation Details</a></li>
             <li><a href="/logLevel">Log Level</a></li>
             <li><a href="/dump">Debug Dump</a></li>
             <li><a href="/jmx">Metrics Dump</a></li>
diff --git 
a/hbase-server/src/main/resources/hbase-webapps/regionserver/rsOperationDetails.jsp
 
b/hbase-server/src/main/resources/hbase-webapps/regionserver/rsOperationDetails.jsp
new file mode 100644
index 0000000..b606ae4
--- /dev/null
+++ 
b/hbase-server/src/main/resources/hbase-webapps/regionserver/rsOperationDetails.jsp
@@ -0,0 +1,176 @@
+<%--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+--%>
+<%@ page contentType="text/html;charset=UTF-8"
+  import="java.util.Date"
+  import="java.util.List"
+  import="java.util.Collections"
+  import="org.apache.hadoop.conf.Configuration"
+  import="org.apache.hadoop.util.StringUtils"
+  import="org.apache.hadoop.hbase.regionserver.HRegionServer"
+  import="org.apache.hadoop.hbase.HConstants"
+  import="org.apache.hadoop.hbase.shaded.protobuf.generated.TooSlowLog"
+  import="org.apache.hadoop.hbase.namequeues.NamedQueueRecorder"
+  import="org.apache.hadoop.hbase.namequeues.RpcLogDetails"
+  import="org.apache.hadoop.hbase.namequeues.request.NamedQueueGetRequest"
+  import="org.apache.hadoop.hbase.namequeues.response.NamedQueueGetResponse"
+  
import="org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponseRequest"
+  
import="org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.SlowLogResponseRequest.LogType"
+%>
+<%
+  HRegionServer rs = (HRegionServer) 
getServletContext().getAttribute(HRegionServer.REGIONSERVER);
+  List<TooSlowLog.SlowLogPayload> slowLogs = Collections.emptyList();
+  List<TooSlowLog.SlowLogPayload> largeLogs = Collections.emptyList();
+  Configuration conf = rs.getConfiguration();
+  boolean isSlowLogEnabled = 
conf.getBoolean(HConstants.SLOW_LOG_BUFFER_ENABLED_KEY, false);
+
+  if(rs.isOnline() && isSlowLogEnabled) {
+    NamedQueueRecorder namedQueueRecorder = rs.getNamedQueueRecorder();
+
+    NamedQueueGetRequest slowRequest = new NamedQueueGetRequest();
+    slowRequest.setNamedQueueEvent(RpcLogDetails.SLOW_LOG_EVENT);
+    slowRequest.setSlowLogResponseRequest(SlowLogResponseRequest.newBuilder()
+      .setLogType(LogType.SLOW_LOG)
+      .setLimit(Integer.MAX_VALUE)
+      .build());
+    NamedQueueGetResponse slowResponse =
+      namedQueueRecorder.getNamedQueueRecords(slowRequest);
+    slowLogs = slowResponse.getSlowLogPayloads();
+
+
+    NamedQueueGetRequest largeRequest = new NamedQueueGetRequest();
+    largeRequest.setNamedQueueEvent(RpcLogDetails.SLOW_LOG_EVENT);
+    largeRequest.setSlowLogResponseRequest(SlowLogResponseRequest.newBuilder()
+      .setLogType(LogType.LARGE_LOG)
+      .setLimit(Integer.MAX_VALUE)
+      .build());
+    NamedQueueGetResponse largeResponse =
+      namedQueueRecorder.getNamedQueueRecords(largeRequest);
+    largeLogs = largeResponse.getSlowLogPayloads();
+  }
+%>
+
+<jsp:include page="header.jsp">
+    <jsp:param name="pageTitle" value="${pageTitle}"/>
+</jsp:include>
+
+
+<div class="container-fluid content">
+  <div class="row">
+    <div class="page-header">
+    <h1>Operations Details</h1>
+    <p>HBase uses some fixed-size ring buffers to maintain rolling window 
history of specific server-side operation details.
+    This page list all operation details retrieve from these ring buffers</p>
+    </div>
+  </div>
+<div class="tabbable">
+  <ul class="nav nav-pills">
+    <li class="active">
+      <a href="#tab_named_queue1" data-toggle="tab"> Slow RPCs </a>
+    </li>
+    <li class="">
+      <a href="#tab_named_queue2" data-toggle="tab"> Large Response RPCs </a>
+    </li>
+  </ul>
+    <div class="tab-content" style="padding-bottom: 9px; border-bottom: 1px 
solid #ddd;">
+      <div class="tab-pane active" id="tab_named_queue1">
+      <p>Slow RPCs record those RPCs whose processing time is greater than the 
threshold (see the setting 'hbase.ipc.warn.response.time' for details)</p>
+        <table class="table table-striped" style="white-space:nowrap">
+        <tr>
+            <th>Start Time</th>
+            <th>Processing Time</th>
+            <th>Queue Time</th>
+            <th>Response Size</th>
+            <th>Client Address</th>
+            <th>Server Class</th>
+            <th>Method Name</th>
+            <th>Region Name</th>
+            <th>User Name</th>
+            <th>MultiGets Count</th>
+            <th>MultiMutations Count</th>
+            <th>MultiService Calls</th>
+            <th>Call Details</th>
+            <th>Param</th>
+          </tr>
+          <% if (slowLogs != null && !slowLogs.isEmpty()) {%>
+            <% for (TooSlowLog.SlowLogPayload r : slowLogs) { %>
+            <tr>
+             <td><%=new Date(r.getStartTime() + 1800*1000)%></td>
+             <td><%=r.getProcessingTime()%>ms</td>
+             <td><%=r.getQueueTime()%>ms</td>
+             <td><%=StringUtils.byteDesc(r.getResponseSize())%></td>
+             <td><%=r.getClientAddress()%></td>
+             <td><%=r.getServerClass()%></td>
+             <td><%=r.getMethodName()%></td>
+             <td><%=r.getRegionName()%></td>
+             <td><%=r.getUserName()%></td>
+             <td><%=r.getMultiGets()%></td>
+             <td><%=r.getMultiMutations()%></td>
+             <td><%=r.getMultiServiceCalls()%></td>
+             <td><%=r.getCallDetails()%></td>
+             <td><%=r.getParam()%></td>
+            </tr>
+            <% } %>
+          <% } %>
+          </table>
+      </div>
+      <div class="tab-pane" id="tab_named_queue2">
+        <p>Large response RPCs record those RPCs whose returned data size is 
greater than the threshold (see the setting'hbase.ipc.warn.response.size' for 
details)</p>
+          <table class="table table-striped" style="white-space:nowrap">
+          <tr>
+            <th>Start Time</th>
+            <th>Processing Time</th>
+            <th>Queue Time</th>
+            <th>Response Size</th>
+            <th>Client Address</th>
+            <th>Server Class</th>
+            <th>Method Name</th>
+            <th>Region Name</th>
+            <th>User Name</th>
+            <th>MultiGets Count</th>
+            <th>MultiMutations Count</th>
+            <th>MultiService Calls</th>
+            <th>Call Details</th>
+            <th>Param</th>
+          </tr>
+          <% if (largeLogs != null && !largeLogs.isEmpty()) {%>
+            <% for (TooSlowLog.SlowLogPayload r : largeLogs) { %>
+            <tr>
+             <td><%=new Date(r.getStartTime() + 1800*1000)%></td>
+             <td><%=r.getProcessingTime()%>ms</td>
+             <td><%=r.getQueueTime()%>ms</td>
+             <td><%=StringUtils.byteDesc(r.getResponseSize())%></td>
+             <td><%=r.getClientAddress()%></td>
+             <td><%=r.getServerClass()%></td>
+             <td><%=r.getMethodName()%></td>
+             <td><%=r.getRegionName()%></td>
+             <td><%=r.getUserName()%></td>
+             <td><%=r.getMultiGets()%></td>
+             <td><%=r.getMultiMutations()%></td>
+             <td><%=r.getMultiServiceCalls()%></td>
+             <td><%=r.getCallDetails()%></td>
+             <td><%=r.getParam()%></td>
+            </tr>
+            <% } %>
+          <% } %>
+          </table>
+      </div>
+  </div>
+</div>
+<jsp:include page="footer.jsp" />

Reply via email to