d-c-manning commented on code in PR #5023:
URL: https://github.com/apache/hbase/pull/5023#discussion_r1113492071


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetricsConnection.java:
##########
@@ -638,16 +641,23 @@ private void shutdown() {
   }
 
   /** Report RPC context to metrics system. */
-  public void updateRpc(MethodDescriptor method, Message param, CallStats 
stats, boolean failed) {
+  public void updateRpc(MethodDescriptor method, Message param, CallStats 
stats, Throwable e) {
     int callsPerServer = stats.getConcurrentCallsPerServer();
     if (callsPerServer > 0) {
       concurrentCallsPerServerHist.update(callsPerServer);
     }
     // Update the counter that tracks RPCs by type.
     final String methodName = method.getService().getName() + "_" + 
method.getName();
     getMetric(CNT_BASE + methodName, rpcCounters, counterFactory).inc();
-    if (failed) {
+    if (e != null) {
       getMetric(FAILURE_CNT_BASE + methodName, rpcCounters, 
counterFactory).inc();
+      if (e instanceof RemoteWithExtrasException) {
+        getMetric(REMOTE_EXCEPTION_CNT_BASE + ((RemoteWithExtrasException) 
e).getClassName(),

Review Comment:
   `getClassName` will add a fully qualified package name into the metric name, 
right? The metric names will become unwieldy since we would have 
`rpcRemoteExceptions_org.apache.hadoop.hbase.CallQueueTooBigException`. If we 
stick with `RemoteWithExtrasException` we could use 
`RemoteWithExtrasException#unwrapRemoteException().getClass().getSimpleName()` 
but that seems heavy. If we can assume that `getClassName` will always return a 
"standard" Exception class, we could just use string manipulation to get the 
String after the last `.`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to