maedhroz commented on code in PR #3742:
URL: https://github.com/apache/cassandra/pull/3742#discussion_r1890817483


##########
src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:
##########
@@ -392,13 +402,54 @@ private void initializeKeyspaces(NodeProbe probe, boolean 
ignore, List<String> t
                 statsTable.topTombstonePartitions = 
table.getTopTombstonePartitions();
                 if (table.getTopTombstonePartitionsLastUpdate() != null)
                     statsTable.topTombstonePartitionsLastUpdate = 
millisToDateString(table.getTopTombstonePartitionsLastUpdate());
+                Object queryLatencyMetric = probe.getSaiMetric(keyspaceName, 
tableName, "QueryLatency"); // Add sai here as well.
+                double QueryLatency = getMetricMean(queryLatencyMetric);
+                statsTable.saiQueryLatencyMs = QueryLatency > 0 ? QueryLatency 
: Double.NaN;
+
+                Object PostFilteringReadLatency = 
probe.getSaiMetric(keyspaceName, tableName, "PostFilteringReadLatency");
+                double postfilteringreadlatency = 
getMetricMean(PostFilteringReadLatency);
+                statsTable.saiPostFilteringReadLatencyms = 
postfilteringreadlatency > 0 ? postfilteringreadlatency : Double.NaN;
+
+                Object diskUsedBytes = probe.getSaiMetric(keyspaceName, 
tableName, "DiskUsedBytes");
+                long saidiskusedbytes = (diskUsedBytes != null) ? (long) 
diskUsedBytes : 0L;
+                statsTable.saiDiskUsedBytes = 
FileUtils.stringifyFileSize(saidiskusedbytes, humanReadable);
+
+                Object SSTableIndexesHit = probe.getSaiMetric(keyspaceName, 
tableName, "SSTableIndexesHit");
+                statsTable.saiSSTableIndexesHit = 
getMetricMean(SSTableIndexesHit);
+
+                Object IndexSegmentsHit = probe.getSaiMetric(keyspaceName, 
tableName, "IndexSegmentsHit");
+                statsTable.saiIndexSegmentsHit = 
getMetricMean(IndexSegmentsHit);
+
+                Object RowsFiltered = probe.getSaiMetric(keyspaceName, 
tableName, "RowsFiltered");
+                statsTable.saiRowsFiltered = getMetricMean(RowsFiltered);
+
+                Object totalQueryTimeouts = probe.getSaiMetric(keyspaceName, 
tableName, "TotalQueryTimeouts");
+                statsTable.saiTotalQueryTimeouts = (totalQueryTimeouts != 
null)  ? (Long) totalQueryTimeouts : 0L;
+
+                Object totalIndexCount = probe.getSaiMetric(keyspaceName, 
tableName, "TotalIndexCount");
+                int saiTotalIndexCount = (totalIndexCount != null) ? (int) 
totalIndexCount : 0;
+
+                Object totalQueryableIndexCount = 
probe.getSaiMetric(keyspaceName, tableName, "TotalQueryableIndexCount");
+                int saiTotalQueryableIndexCount = (totalQueryableIndexCount != 
null) ? (int) totalQueryableIndexCount : 0;
+
+                statsTable.saiTotalQueryableIndexRatio = 
String.format("%d/%d", saiTotalIndexCount, saiTotalQueryableIndexCount);

Review Comment:
   Could we avoid the entire block above if we're looking at a system keyspace? 
We've got a check at print-time in `TableStatsPrinter`, but it seems like we 
might as well avoid hitting the probe here if we're not going to print the info 
anyway?



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