maedhroz commented on code in PR #3742:
URL: https://github.com/apache/cassandra/pull/3742#discussion_r1887457400
##########
src/java/org/apache/cassandra/tools/NodeProbe.java:
##########
@@ -1892,7 +1892,66 @@ public Object getThreadPoolMetric(String pathName,
String poolName, String metri
}
}
- /**
+ public Object getSAIIndexMetrics(String ks, String cf, String metricName) {
+ try {
+ String scope = getScopeForMetric(metricName);
+ String objectNameStr =
String.format("org.apache.cassandra.metrics:type=StorageAttachedIndex,keyspace=%s,table=%s,scope=%s,name=%s",ks,
cf, scope, metricName);
+ ObjectName oName = new ObjectName(objectNameStr);
+
+ Set<ObjectName> matchingMBeans = mbeanServerConn.queryNames(oName,
null);
+ if (matchingMBeans.isEmpty()) {
+ return null;
+ }
+
+ return getMetricValue(metricName, oName);
+ } catch (MalformedObjectNameException e) {
+ throw new RuntimeException("Invalid ObjectName format: " +
e.getMessage(), e);
+ } catch (IOException e) {
+ throw new RuntimeException("Error accessing MBean server: " +
e.getMessage(), e);
+ }
+ }
+
+ private Object getMetricValue(String metricName, ObjectName oName) throws
IOException {
Review Comment:
```suggestion
private Object getSaiMetricValue(String metricName, ObjectName oName)
throws IOException {
```
--
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]