X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Ftools%2Fnetconf-testtool%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftest%2Ftool%2Fclient%2Fhttp%2Fperf%2FRestPerfClient.java;h=5f6f490afc02069bfef37e9f61ae75433f0efc15;hb=1e8b89a012bbaf8b37d3270b68ca860e6389a8cd;hp=270f6b0db94ecf7b54b5bde1c870da006eb7069b;hpb=cdea09e3a7291fe759a992671b2c6c2dac52cd43;p=netconf.git diff --git a/opendaylight/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java b/opendaylight/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java index 270f6b0db9..5f6f490afc 100644 --- a/opendaylight/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java +++ b/opendaylight/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/RestPerfClient.java @@ -20,7 +20,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import net.sourceforge.argparse4j.inf.ArgumentParser; import net.sourceforge.argparse4j.inf.ArgumentParserException; import org.opendaylight.netconf.test.tool.TestToolUtils; @@ -133,18 +132,23 @@ public class RestPerfClient { LOG.info("Starting performance test"); final Stopwatch started = Stopwatch.createStarted(); try { - final List> futures = executorService.invokeAll(callables, 5, TimeUnit.MINUTES); - for (final Future future : futures) { - try { - future.get(4L, TimeUnit.MINUTES); - } catch (ExecutionException | TimeoutException e) { - throw new RuntimeException(e); + final List> futures = executorService.invokeAll(callables, parameters.timeout, TimeUnit.MINUTES); + for (int i = 0; i < futures.size(); i++) { + Future future = futures.get(i); + if (future.isCancelled()) { + LOG.info("{}. thread timed out.", i + 1); + } else { + try { + future.get(); + } catch (final ExecutionException e) { + LOG.info("{}. thread failed.", i + 1, e); + } } } - executorService.shutdownNow(); } catch (final InterruptedException e) { - throw new RuntimeException("Unable to execute requests", e); + LOG.warn("Unable to execute requests", e); } + executorService.shutdownNow(); started.stop(); LOG.info("FINISHED. Execution time: {}", started);