assertTrue("Not all stores were properly shut down", stores.isEmpty());
}
private void mapTestReadWriteRemove(String name, AbstractDelegatingStore store,
int numKeys, int readerThreads, int writerThreads, int removerThreads) throws Exception {
DummyInMemoryCacheStore delegate = (DummyInMemoryCacheStore) store.getDelegate();
try {
// warm up for 1 second
System.out.printf("[store=%s] Warming up\n", name);
runMapTestReadWriteRemove(name, store, readerThreads, writerThreads, removerThreads, 1000);
// real test
System.out.printf("[store=%s] Testing...\n", name);
TotalStats perf = runMapTestReadWriteRemove(name, store, readerThreads, writerThreads, removerThreads, RUNNING_TIME);
// Wait until the cache store contains the expected state
System.out.printf("[store=%s] Verify contents\n", name);
delegate.blockUntilCacheStoreContains(expectedState.keySet(), 60000);
System.out.printf("Container %-12s ", name);
System.out.printf("Ops/s %10.2f ", perf.getTotalOpsPerSec());
System.out.printf("Gets/s %10.2f ", perf.getOpsPerSec("GET"));
System.out.printf("Puts/s %10.2f ", perf.getOpsPerSec("PUT"));
System.out.printf("Removes/s %10.2f ", perf.getOpsPerSec("REMOVE"));
System.out.printf("HitRatio %10.2f ", perf.getTotalHitRatio() * 100);
System.out.printf("Size %10d ", store.loadAllKeys(null).size());
double stdDev = computeStdDev(store, numKeys);
System.out.printf("StdDev %10.2f\n", stdDev);
} finally {
// Clean up state, expected state and keys
expectedState.clear();
delegate.clear();
}
}