use of org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBenchOutput in project controller by opendaylight.
the class GlobalBindingRTCServer method routedRpcBench.
@Override
public Future<RpcResult<RoutedRpcBenchOutput>> routedRpcBench(final RoutedRpcBenchInput input) {
RoutedRpcBenchOutput output = new RoutedRpcBenchOutputBuilder(input).build();
RpcResult<RoutedRpcBenchOutput> result = RpcResultBuilder.success(output).build();
numRpcs++;
return Futures.immediateFuture(result);
}
use of org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBenchOutput in project controller by opendaylight.
the class RoutedBindingRTClient method runTest.
public void runTest(final int iterations) {
int rpcOk = 0;
int rpcError = 0;
int rpcServerCnt = inVal.size();
for (int i = 0; i < iterations; i++) {
RoutedRpcBenchInput input = inVal.get(ThreadLocalRandom.current().nextInt(rpcServerCnt));
Future<RpcResult<RoutedRpcBenchOutput>> output = service.routedRpcBench(input);
try {
RpcResult<RoutedRpcBenchOutput> rpcResult = output.get();
if (rpcResult.isSuccessful()) {
List<Payload> retVal = rpcResult.getResult().getPayload();
if (retVal.size() == inSize) {
rpcOk++;
} else {
rpcError++;
}
}
} catch (InterruptedException | ExecutionException e) {
rpcError++;
LOG.error("Execution failed: ", e);
}
}
this.rpcOk.addAndGet(rpcOk);
this.rpcError.addAndGet(rpcError);
}
Aggregations