Skip to content

Commit

Permalink
Merge branch 'cassandra-4.0' into cassandra-4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
driftx committed Aug 18, 2023
2 parents 0d6d8a8 + fb395c6 commit cd3e564
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Merged from 4.0:
* Migrate Python optparse to argparse (CASSANDRA-17914)
Merged from 3.11:
Merged from 3.0:
* Fix missing speculative retries in tablestats (CASSANDRA-18767)
* Fix Requires for Java for RPM package (CASSANDRA-18751)
* Fix CQLSH online help topic link (CASSANDRA-17534)
* Remove unused suppressions (CASSANDRA-18724)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class StatsTable
public boolean memtableOffHeapUsed = false;
public String memtableOffHeapMemoryUsed;
public Object memtableSwitchCount;
public Object speculativeRetries;
public long localReadCount;
public double localReadLatencyMs;
public long localWriteCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ private Map<String, Object> convertStatsTableToMap(StatsTable table)
if (table.memtableOffHeapUsed)
mpTable.put("memtable_off_heap_memory_used", table.memtableOffHeapMemoryUsed);
mpTable.put("memtable_switch_count", table.memtableSwitchCount);
mpTable.put("speculative_retries", table.speculativeRetries);
mpTable.put("local_read_count", table.localReadCount);
mpTable.put("local_read_latency_ms", String.format("%01.3f", table.localReadLatencyMs));
mpTable.put("local_write_count", table.localWriteCount);
Expand Down Expand Up @@ -321,6 +322,7 @@ private void initializeKeyspaces(NodeProbe probe, boolean ignore, List<String> t
statsTable.memtableOffHeapMemoryUsed = format(memtableOffHeapSize, humanReadable);
}
statsTable.memtableSwitchCount = probe.getColumnFamilyMetric(keyspaceName, tableName, "MemtableSwitchCount");
statsTable.speculativeRetries = probe.getColumnFamilyMetric(keyspaceName, tableName, "SpeculativeRetries");
statsTable.localReadCount = ((CassandraMetricsRegistry.JmxTimerMBean) probe.getColumnFamilyMetric(keyspaceName, tableName, "ReadLatency")).getCount();

double localReadLatency = ((CassandraMetricsRegistry.JmxTimerMBean) probe.getColumnFamilyMetric(keyspaceName, tableName, "ReadLatency")).getMean() / 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ protected void printStatsTable(StatsTable table, String tableDisplayName, String
if (table.memtableOffHeapUsed)
out.println(indent + "Memtable off heap memory used: " + table.memtableOffHeapMemoryUsed);
out.println(indent + "Memtable switch count: " + table.memtableSwitchCount);
out.println(indent + "Speculative retries: " + table.speculativeRetries);
out.println(indent + "Local read count: " + table.localReadCount);
out.printf(indent + "Local read latency: %01.3f ms%n", table.localReadLatencyMs);
out.println(indent + "Local write count: " + table.localWriteCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable cell count: 111\n" +
"\tMemtable data size: 0\n" +
"\tMemtable switch count: 1\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 0\n" +
"\tLocal read latency: 2.000 ms\n" +
"\tLocal write count: 5\n" +
Expand Down Expand Up @@ -81,6 +82,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable data size: 900\n" +
"\tMemtable off heap memory used: 314159265\n" +
"\tMemtable switch count: 22222\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 1\n" +
"\tLocal read latency: 3.000 ms\n" +
"\tLocal write count: 4\n" +
Expand Down Expand Up @@ -119,6 +121,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable cell count: 333333\n" +
"\tMemtable data size: 1999\n" +
"\tMemtable switch count: 3333\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 2\n" +
"\tLocal read latency: 4.000 ms\n" +
"\tLocal write count: 3\n" +
Expand Down Expand Up @@ -156,6 +159,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable data size: 3000\n" +
"\tMemtable off heap memory used: 141421356\n" +
"\tMemtable switch count: 444444\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 3\n" +
"\tLocal read latency: NaN ms\n" +
"\tLocal write count: 2\n" +
Expand Down Expand Up @@ -194,6 +198,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable cell count: 55555\n" +
"\tMemtable data size: 20000\n" +
"\tMemtable switch count: 5\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 4\n" +
"\tLocal read latency: 0.000 ms\n" +
"\tLocal write count: 1\n" +
Expand Down Expand Up @@ -231,6 +236,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
"\tMemtable data size: 1000000\n" +
"\tMemtable off heap memory used: 161803398\n" +
"\tMemtable switch count: 6\n" +
"\tSpeculative retries: 0\n" +
"\tLocal read count: 5\n" +
"\tLocal read latency: 1.000 ms\n" +
"\tLocal write count: 0\n" +
Expand Down Expand Up @@ -401,6 +407,7 @@ public void testJsonPrinter() throws Exception
" \"bloom_filter_off_heap_memory_used\" : \"667408\",\n" +
" \"bytes_pending_repair\" : 0,\n" +
" \"memtable_switch_count\" : 6,\n" +
" \"speculative_retries\" : 0,\n" +
" \"maximum_tombstones_per_slice_last_five_minutes\" : 6,\n" +
" \"memtable_cell_count\" : 6666,\n" +
" \"memtable_data_size\" : \"1000000\",\n" +
Expand Down Expand Up @@ -467,6 +474,7 @@ public void testYamlPrinter() throws Exception
" bloom_filter_off_heap_memory_used: '667408'\n" +
" bytes_pending_repair: 0\n" +
" memtable_switch_count: 6\n" +
" speculative_retries: 0\n" +
" maximum_tombstones_per_slice_last_five_minutes: 6\n" +
" memtable_cell_count: 6666\n" +
" memtable_data_size: '1000000'\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private static StatsTable createStatsTableTemplate(String keyspaceName, String t
template.memtableCellCount = 0L;
template.memtableDataSize = "0";
template.memtableSwitchCount = 0L;
template.speculativeRetries = 0L;
template.localReadCount =0L;
template.localReadLatencyMs = Double.NaN;
template.localWriteCount = 0L;
Expand Down

0 comments on commit cd3e564

Please sign in to comment.