}
};
// trigger classloading a couple times
{
ClientConfig config = new ClientConfig("program", "none");
Client client = ClientFactory.createClient(config);
client.createConnection("localhost");
for (int i = 0; i < 10000; i++)
client.callProcedure("EmptyProcedure", 0L);
}
ExecutorService executor = Executors
.newFixedThreadPool(clientCount);
ArrayList<Future<Integer>> futures = new ArrayList<Future<Integer>>(
clientCount);
final CyclicBarrier barrier = new CyclicBarrier(clientCount + 1);
final long stopTime = System.currentTimeMillis() + 2000;
for (int i = 0; i < clientCount; i++) {
futures.add(executor.submit(new Callable<Integer>() {
public Integer call() {
try {
ClientConfig config = new ClientConfig("program", "none");
Client client = ClientFactory.createClient(config);
client.createConnection("localhost");
int count = 0;
barrier.await();