szetszwo commented on code in PR #742:
URL: https://github.com/apache/ratis/pull/742#discussion_r972085788


##########
ratis-netty/src/main/java/org/apache/ratis/netty/metrics/NettyServerStreamRpcMetrics.java:
##########
@@ -88,11 +92,32 @@ public void stop(Timekeeper.Context context, boolean 
success) {
     }
   }
 
+  private enum Op {
+    Create(RequestType::getNumRequestsString),
+    Success(RequestType::getSuccessCountString),
+    Fail(RequestType::getFailCountString);
+
+    private final Function<RequestType, String> stringFunction;
+
+    Op(Function<RequestType, String> stringFunction) {
+      this.stringFunction = stringFunction;
+    }
+
+    String getString(RequestType type) {
+      return stringFunction.apply(type);
+    }
+  }
+
+  private final Map<String, Timekeeper> latencyTimers = new 
ConcurrentHashMap<>();
+  private final Map<Op, Map<String, LongCounter>> ops;
+
   public NettyServerStreamRpcMetrics(String serverId) {
-    registry = getMetricRegistryForGrpcServer(serverId);
+    super(getMetricRegistryForGrpcServer(serverId));

Review Comment:
   Done.



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