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


##########
src/java/org/apache/cassandra/metrics/ClientMetrics.java:
##########
@@ -118,6 +193,31 @@ public long getCount()
         authSuccess = registerMeter("AuthSuccess");
         authFailure = registerMeter("AuthFailure");
 
+        // For each of SSL, non-SSL register a gauge:
+        encryptedConnectedNativeClients = registerGauge(new 
DefaultNameFactory("Client", "Encrypted"), CONNECTED_NATIVE_CLIENTS, () -> 
countConnectedClients((ServerConnection::isSSL)));
+        unencryptedConnectedNativeClients = registerGauge(new 
DefaultNameFactory("Client", "Unencrypted"), CONNECTED_NATIVE_CLIENTS, () -> 
countConnectedClients(((ServerConnection connection) -> !connection.isSSL())));
+
+        // for each supported authentication mode, register a meter for 
success and failures.
+        final IAuthenticator authenticator = 
DatabaseDescriptor.getAuthenticator();
+        for (String mode : authenticator.getSupportedAuthenticationModes())
+        {
+            String capitalizedMode = StringUtils.capitalize(mode);

Review Comment:
   why can't we save the mode capitalized already? If `mode` was an enum, you 
would just use its name. 
   
   If there is a 3rd party implementation with some custom mode and they do not 
capitalize it, why are we making them uppercased? If they want to have it 
upper-cased, they should capitalize it themselves. If they want to have it 
lower cased, they will.



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