changeset 526:c72b7f546870

minor
author Devel 2
date Tue, 29 Aug 2017 12:45:42 +0200
parents 924eac805b34
children 05d63b5bf1d1
files stress-tester/src/main/java/com/passus/st/client/http/HttpFlowContext.java stress-tester/src/main/java/com/passus/st/client/http/HttpSynchClientWorker.java stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilter.java stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java
diffstat 4 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpFlowContext.java	Tue Aug 29 12:45:02 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpFlowContext.java	Tue Aug 29 12:45:42 2017 +0200
@@ -16,8 +16,6 @@
  */
 public class HttpFlowContext {
 
-    private static final Logger LOGGER = LogManager.getLogger(HttpFlowContext.class);
-
     public static final int STATE_ERROR = -1;
     public static final int STATE_CONNECTING = 0;
     public static final int STATE_CONNECTED = 1;
@@ -47,7 +45,7 @@
     long receivedStartTimestamp = -1;
 
     long sendStartTimestamp = -1;
-    
+
     public HttpFlowContext(SessionInfo session, HttpScopes scopes) {
         this.scopes = scopes;
         this.session = session;
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpSynchClientWorker.java	Tue Aug 29 12:45:02 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpSynchClientWorker.java	Tue Aug 29 12:45:42 2017 +0200
@@ -8,7 +8,6 @@
 import com.passus.st.client.SessionEvent;
 import com.passus.st.client.SessionStatusEvent;
 import com.passus.st.emitter.Emitter;
-import com.passus.st.emitter.SessionInfo;
 import com.passus.st.plugin.PluginConstants;
 import java.util.concurrent.LinkedBlockingDeque;
 
@@ -52,7 +51,10 @@
 
     @Override
     protected void flowStateChanged(HttpFlowContext context, int oldState) {
-        logger.debug("flowStateChanged {},{}", context == currFlowContext, context.state());
+        if (logger.isDebugEnabled()) {
+            logger.debug("flowStateChanged {},{}", context == currFlowContext, context.stateString());
+        }
+
         if (context == currFlowContext) {
             if (context.state() == HttpFlowContext.STATE_CONNECTED
                     || context.state() == HttpFlowContext.STATE_RESP_RECEIVED
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilter.java	Tue Aug 29 12:45:02 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilter.java	Tue Aug 29 12:45:42 2017 +0200
@@ -27,11 +27,11 @@
 
     }
 
-    public int filterInbound(HttpRequest request, HttpResponse resp, HttpFlowContext context) {
+    public int filterInbound(HttpRequest req, HttpResponse resp, HttpFlowContext context) {
         return DUNNO;
     }
 
-    public int filterOutbound(HttpRequest request, HttpResponse resp, HttpFlowContext context) {
+    public int filterOutbound(HttpRequest req, HttpResponse resp, HttpFlowContext context) {
         return DUNNO;
     }
 
--- a/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java	Tue Aug 29 12:45:02 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitterWorker.java	Tue Aug 29 12:45:42 2017 +0200
@@ -371,7 +371,9 @@
         }
 
         if (collectMetrics) {
-            metric.errorCaught(cause);
+            synchronized (metric) {
+                metric.errorCaught(cause);
+            }
         }
 
         KeyContext keyContext = (KeyContext) key.attachment();