ndimiduk commented on a change in pull request #754: HBASE-22978 : Online slow 
response log
URL: https://github.com/apache/hbase/pull/754#discussion_r371438102
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
 ##########
 @@ -496,11 +522,44 @@ void logResponse(Message param, String methodName, 
String call, String tag,
           }
         }
       }
-      responseInfo.put("multi.gets", numGets);
-      responseInfo.put("multi.mutations", numMutations);
-      responseInfo.put("multi.servicecalls", numServiceCalls);
+      responseInfo.put(MULTI_GETS, numGets);
+      responseInfo.put(MULTI_MUTATIONS, numMutations);
+      responseInfo.put(MULTI_SERVICECALLS, numServiceCalls);
     }
+    final String tag = tooLarge ? "TooLarge" : "TooSlow";
     LOG.warn("(response" + tag + "): " + GSON.toJson(responseInfo));
+    if (isOnlineSlowLogProviderEnabled && !tooLarge && 
this.onlineSlowLogProvider != null
+        && !call.startsWith("GetSlowLogResponses")
+        && !call.startsWith("ClearSlowLogsResponses")) {
+      // add too slow log to ringbuffer for retrieval of latest n slow logs
+
+      try {
+        final SlowLogParams slowLogParams = 
ProtobufUtil.getSlowLogParams(param);
+
+        final SlowLogPayload slowLogPayload = SlowLogPayload.newBuilder()
+          .setStartTime(startTime)
+          .setProcessingTime(processingTime)
+          .setQueueTime(qTime)
+          .setResponseSize(responseSize)
+          .setClientAddress(clientAddress)
+          .setServerClass(className)
+          .setMethodName(methodName)
+          .setCallDetails(call)
+          .setUserName(userName)
+          .setRegionName(slowLogParams != null ? slowLogParams.getRegionName() 
: StringUtils.EMPTY)
 
 Review comment:
   What's the point of making these `required` in the protobuf definition if 
you're just going to shove empty strings in? When a value isn't available, make 
them `optional` and leave them unset.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to