use of org.apache.cassandra.metrics.CQLMetrics in project cassandra by apache.
the class CQLMetricsTableTest method testUsingInjectedValues.
@Test
public void testUsingInjectedValues() throws Throwable {
CQLMetrics cqlMetrics = new CQLMetrics();
CQLMetricsTable table = new CQLMetricsTable(KS_NAME, cqlMetrics);
VirtualKeyspaceRegistry.instance.register(new VirtualKeyspace(KS_NAME, ImmutableList.of(table)));
// With initial injected values
cqlMetrics.preparedStatementsExecuted.inc(50);
cqlMetrics.regularStatementsExecuted.inc(100);
cqlMetrics.preparedStatementsEvicted.inc(25);
queryAndValidateMetrics(cqlMetrics);
// Test again with updated values
cqlMetrics.preparedStatementsExecuted.inc(150);
cqlMetrics.regularStatementsExecuted.inc(200);
cqlMetrics.preparedStatementsEvicted.inc(50);
queryAndValidateMetrics(cqlMetrics);
}
Aggregations