connectionCount = Integer.parseInt(args[1]);
channelPerConnectionCount = Integer.parseInt(args[2]);
heartbeatInterval = Integer.parseInt(args[3]);
rate = (args.length > 4) ? Double.parseDouble(args[4]) : 1.0;
ConnectionFactory factory = new ConnectionFactory();
factory.setRequestedHeartbeat(heartbeatInterval);
for (int i = 0; i < connectionCount; i++) {
System.out.println("Starting connection " + i);
factory.setUri(uri);
final Connection conn = factory.newConnection();
for (int j = 0; j < channelPerConnectionCount; j++) {
final Channel ch = conn.createChannel();
final int threadNumber = i * channelPerConnectionCount + j;