Mercurial > stress-tester
changeset 538:83edfa7af445
HttpAsynchClientWorker.responseSynch param
author | Devel 2 |
---|---|
date | Mon, 11 Sep 2017 12:17:48 +0200 |
parents | a3cf7c67258e |
children | 40b568fc8bec |
files | stress-tester/src/main/java/com/passus/st/client/http/HttpAsynchClientWorker.java |
diffstat | 1 files changed, 17 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpAsynchClientWorker.java Mon Sep 11 11:57:05 2017 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpAsynchClientWorker.java Mon Sep 11 12:17:48 2017 +0200 @@ -42,6 +42,8 @@ private final Object readerLock = new Object(); + private boolean responseSynch = false; + public HttpAsynchClientWorker(Emitter emitter, String name, int index) { super(emitter, name, index); @@ -65,6 +67,14 @@ this.waitTimeout = waitTimeout; } + public boolean isResponseSynch() { + return responseSynch; + } + + public void setResponseSynch(boolean responseSynch) { + this.responseSynch = responseSynch; + } + private void waitQuietly() { try { lock.wait(waitTimeout); @@ -165,12 +175,14 @@ SessionEventsTask task = window.getSessionEventsTask(session, true); task.events.add(payloadEvent); - /*HttpResponse resp = payloadEvent.getResponse(); - HttpRequest req = payloadEvent.getRequest(); - long respTime = time + (resp.getTimestamp() - req.getTimestamp()); - HttpResponseEvent respEvent = new HttpResponseEvent(session, resp, respTime); + if (responseSynch) { + HttpResponse resp = payloadEvent.getResponse(); + HttpRequest req = payloadEvent.getRequest(); + long respTime = time + (resp.getTimestamp() - req.getTimestamp()); + HttpResponseEvent respEvent = new HttpResponseEvent(session, resp, respTime); - task.events.add(respEvent);*/ + task.events.add(respEvent); + } break; }