Merge branch 'cassandra-4.0' into cassandra-4.1

This commit is contained in:
Brandon Williams 2023-08-18 05:11:33 -05:00
commit cd3e564fb2
6 changed files with 14 additions and 0 deletions

View File

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

View File

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

View File

@ -135,6 +135,7 @@ public class TableStatsHolder implements StatsHolder
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);
@ -321,6 +322,7 @@ public class TableStatsHolder implements StatsHolder
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;

View File

@ -101,6 +101,7 @@ public class TableStatsPrinter<T extends StatsHolder>
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);

View File

@ -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" +
@ -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" +
@ -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" +
@ -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" +
@ -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" +
@ -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" +
@ -401,6 +407,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
" \"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" +
@ -467,6 +474,7 @@ public class TableStatsPrinterTest extends TableStatsTestBase
" 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" +

View File

@ -81,6 +81,7 @@ public class TableStatsTestBase
template.memtableCellCount = 0L;
template.memtableDataSize = "0";
template.memtableSwitchCount = 0L;
template.speculativeRetries = 0L;
template.localReadCount =0L;
template.localReadLatencyMs = Double.NaN;
template.localWriteCount = 0L;