Search in sources :

Example 1 with ClearableHistogram

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);
}
Also used : ClearableHistogram(org.apache.cassandra.metrics.ClearableHistogram) ColumnFamilyStore(org.apache.cassandra.db.ColumnFamilyStore)

Aggregations

ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)1 ClearableHistogram (org.apache.cassandra.metrics.ClearableHistogram)1