changeset 546:0ac2d45a0dd8

reporterClient.waitForEmptyQueue
author Devel 1
date Thu, 14 Sep 2017 14:15:45 +0200
parents 17a5815215fd
children 0de0512fc8e0
files stress-tester/src/main/java/com/passus/st/Main.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/Main.java	Thu Sep 14 10:14:20 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/Main.java	Thu Sep 14 14:15:45 2017 +0200
@@ -213,7 +213,6 @@
             NioEmitter emitter = new NioEmitter();
             emitter.setSessionMapper(mapper);
             emitter.setCollectMetrics(true);
-            emitter.start();
 
             HttpClient client = new HttpClient(emitter);
             client.setCollectMetrics(true);
@@ -227,6 +226,7 @@
 
                 int parallelReplays = Integer.parseInt(cl.getOptionValue("pr"));
                 if (parallelReplays > 0 && parallelReplays <= 100) {
+//                    emitter.setMaxThreads(parallelReplays);
                     client.setWorkersNum(parallelReplays);
                 } else {
                     throw new IllegalArgumentException("Parameter \"parallelReplays\" should be in range 1-100.");
@@ -235,6 +235,7 @@
                 client.setWorkersNum(clArgs.length);
                 client.setDispatcher(new HttpSourceNameAwareClientWorkerDispatcher());
             }
+            emitter.start();
 
             if (cl.hasOption("rs")) {
                 float speed = Float.parseFloat(cl.getOptionValue("rs"));
@@ -404,6 +405,7 @@
             client.stop();
             emitter.stop();
             if (reporterClient != null) {
+                reporterClient.waitForEmptyQueue();
                 reporterClient.stop();
             }
             if (summaryListener != null) {