Thread thread = new Thread(runnable);
threads[i] = thread;
runnables[i] = runnable;
}
StatisticsSnapshot snapshotBefore = rootGroup.getStatisticsSnapshot();
for (int i = 0; i < threads.length; i++) {
Thread thread = threads[i];
thread.start();
}
boolean failed = false;
for (int i = 0; i < threads.length; i++) {
Thread thread = threads[i];
MyRunnable runnable = runnables[i];
thread.join();
if (runnable.failed()) {
String errors = runnable.getErrors();
if (errors != null) {
if (logger.isDebugEnabled()) {
logger.debug(errors);
}
}
failed = true;
}
}
if (failed) {
fail("Stress test failed due to exceptions thrown by threads");
}
// Validate the internal structure of the cache.
ensureCacheIntegrity(cache);
StatisticsSnapshot snapshotAfter = rootGroup.getStatisticsSnapshot();
StatisticsDelta delta = snapshotAfter.difference(snapshotBefore);
System.out.println("Period: " + delta.getPeriod());
System.out.println("Hit count: " + delta.getHitCount());
System.out.println("Missed / Added count: " + delta.getMissedAddedCount());
System.out.println("Removed count: " + delta.getRemovedCount());
System.out.println("Change count: " +