use of org.apache.cassandra.metrics.ClearableHistogram in project cassandra by apache.
the class SSTablesIteratedTest method executeAndCheck.
private void executeAndCheck(String query, int numSSTables, Object[]... rows) throws Throwable {
ColumnFamilyStore cfs = getCurrentColumnFamilyStore(KEYSPACE_PER_TEST);
// resets counts
((ClearableHistogram) cfs.metric.sstablesPerReadHistogram.cf).clear();
assertRows(execute(query), rows);
// max sstables read
long numSSTablesIterated = cfs.metric.sstablesPerReadHistogram.cf.getSnapshot().getMax();
assertEquals(String.format("Expected %d sstables iterated but got %d instead, with %d live sstables", numSSTables, numSSTablesIterated, cfs.getLiveSSTables().size()), numSSTables, numSSTablesIterated);
}
Aggregations