blob: 4dcb35e0de206312d0bc04f9ff10f2ef5d353f9b [file] [log] [blame]
package com.alibaba.dubbo.rpc.benchmark;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
public class RpcBenchmarkClient extends AbstractBenchmarkClient {
@SuppressWarnings("rawtypes")
@Override
public ClientRunnable getClientRunnable(String targetIP, int targetPort, int clientNums, int rpcTimeout,
CyclicBarrier barrier, CountDownLatch latch, long startTime, long endTime) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
String runnable = properties.getProperty("classname");
Class[] parameterTypes = new Class[] { String.class, int.class, int.class, int.class, CyclicBarrier.class,
CountDownLatch.class, long.class, long.class };
Object[] parameters = new Object[] { targetIP, targetPort, clientNums, rpcTimeout, barrier, latch, startTime,
endTime };
return (ClientRunnable) Class.forName(runnable).getConstructor(parameterTypes).newInstance(parameters);
}
public static void main(String[] args) throws Exception {
new RpcBenchmarkClient().run(args);
}
}