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


##########
src/java/org/apache/cassandra/tools/nodetool/stats/TableStatsHolder.java:
##########
@@ -393,12 +404,59 @@ private void initializeKeyspaces(NodeProbe probe, boolean 
ignore, List<String> t
                 if (table.getTopTombstonePartitionsLastUpdate() != null)
                     statsTable.topTombstonePartitionsLastUpdate = 
millisToDateString(table.getTopTombstonePartitionsLastUpdate());
 
+                if (!SchemaConstants.isSystemKeyspace(keyspaceName))
+                {
+                    if (table.hasStorageAttachedIndex())
+                    {
+                        Object queryLatencyMetric = 
probe.getSaiMetric(keyspaceName, tableName, "QueryLatency");
+                        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");
+                        statsTable.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", statsTable.saiTotalIndexCount, 
saiTotalQueryableIndexCount);

Review Comment:
   Is it the same as the `FBUtilities.prettyPrintRatio` and we could replace it?



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