skoppu22 commented on code in PR #152:
URL: https://github.com/apache/cassandra-sidecar/pull/152#discussion_r1869930547


##########
server/src/main/java/org/apache/cassandra/sidecar/routes/AbstractHandler.java:
##########
@@ -331,4 +334,34 @@ public static String extractHostAddressWithoutPort(String 
address)
         }
         return address;
     }
+
+    protected StorageOperations getStorageOperations(String host)
+    {
+        CassandraAdapterDelegate delegate = 
this.metadataFetcher.delegate(host);
+        StorageOperations storageOperations = delegate == null ? null : 
delegate.storageOperations();
+        if (storageOperations == null)
+        {
+            throw cassandraServiceUnavailable();
+        }
+
+
+        return storageOperations;
+    }
+
+    protected <V> void updateJmxMetric(AsyncResult<V> result,
+                                       JmxOperationsMetrics 
jmxOperationsMetrics,
+                                       String operationName,
+                                       long startTime)
+    {
+        if (result.succeeded())
+        {
+            jmxOperationsMetrics.recordTimeTaken(operationName + "Succeeded",

Review Comment:
   If we split the status, the metric would be like (<jmx operation name>, 
<status>, <timetaken>), i.e, that will be triplet. And also we may need count 
of failures to trigger escalation if needed, i.e, count after filtering on 
first two in this triplet. I am not sure is it feasible with metric system and 
dashboards we have now (I am not very good in these). Most of our code (in 
mgr), we have (operationName_succeeded, timetaken) or (operationName_failed, 
timetaken), as it is easy to filter on particular operation failures and set 
alert on count of failures. 



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