smiklosovic commented on code in PR #3085:
URL: https://github.com/apache/cassandra/pull/3085#discussion_r1479351124


##########
src/java/org/apache/cassandra/metrics/ClientMetrics.java:
##########
@@ -51,20 +93,56 @@ public final class ClientMetrics
     private Meter protocolException;
     private Meter unknownException;
 
+    private static final String AUTH_SUCCESS = "AuthSuccess";
+
+    private static final String AUTH_FAILURE = "AuthFailure";
+
+    private static final String CONNECTED_NATIVE_CLIENTS = 
"ConnectedNativeClients";
+
     private ClientMetrics()
     {
     }
 
+    /**
+     * @deprecated by {@link #markAuthSuccess(String)}
+     */
+    @Deprecated(since="5.1", forRemoval = true)
     public void markAuthSuccess()
     {
-        authSuccess.mark();
+        markAuthSuccess(null);
     }
 
+    public void markAuthSuccess(String mode)
+    {
+        markAuthMeter(authSuccess, authSuccessByMode, mode);
+    }
+
+    /**
+     * @deprecated by {@link #markAuthFailure(String)}
+     */
+    @Deprecated(since="5.1", forRemoval = true)
     public void markAuthFailure()
     {
         authFailure.mark();
     }
 
+    public void markAuthFailure(String mode)
+    {
+        markAuthMeter(authFailure, authFailureByMode, mode);
+    }
+
+    private void markAuthMeter(Meter meter, Map<String, Meter> meterMap, 
String mode)

Review Comment:
   I would personally get rid of this method and just put it into methods which 
call this logic. The only variable there would be `meter` and `meterMap` which 
would be either `authFailureByMode` or `authSuccessByMode`. This kind of 
repetition is not a big deal ... I just dont see any "win" by having this 
method.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to