assertTrue("Not all stores were properly shut down", stores.isEmpty());
}
private void mapTestReadWriteRemove(String name, AdvancedCacheLoader loader, AdvancedCacheWriter writer,
int numKeys, int readerThreads, int writerThreads, int removerThreads) throws Exception {
DummyInMemoryStore delegate = (DummyInMemoryStore) ((DelegatingCacheLoader) loader).undelegate();
try {
// warm up for 1 second
System.out.printf("[store=%s] Warming up\n", name);
runMapTestReadWriteRemove(name, loader, writer, readerThreads, writerThreads, removerThreads, 1000);
// real test
System.out.printf("[store=%s] Testing...\n", name);
TotalStats perf = runMapTestReadWriteRemove(name, loader, writer, 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 ", PersistenceUtil.count(loader, null));
double stdDev = computeStdDev(loader, numKeys);
System.out.printf("StdDev %10.2f\n", stdDev);
} finally {
// Clean up state, expected state and keys
expectedState.clear();
delegate.clear();
}
}