You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/05/18 18:46:01 UTC

svn commit: r1484145 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Author: adrianc
Date: Sat May 18 16:46:01 2013
New Revision: 1484145

URL: http://svn.apache.org/r1484145
Log:
Fixed a bug in the performance metrics feature where the wrong request Map was being updated in some cases.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1484145&r1=1484144&r2=1484145&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sat May 18 16:46:01 2013
@@ -168,6 +168,7 @@ public class RequestHandler {
         if (requestMap.metrics != null && requestMap.metrics.getThreshold() != 0.0 && requestMap.metrics.getTotalEvents() > 3 && requestMap.metrics.getThreshold() < requestMap.metrics.getServiceRate()) {
             eventReturn = "threshold-exceeded";
         }
+        ConfigXMLReader.RequestMap originalRequestMap = requestMap; // Save this so we can update the correct performance metrics.
 
         boolean interruptRequest = false;
 
@@ -675,8 +676,8 @@ public class RequestHandler {
                 if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is handled by the event." + " sessionId=" + UtilHttp.getSessionId(request), module);
             }
         }
-        if (requestMap.metrics != null) {
-            requestMap.metrics.recordServiceRate(1, System.currentTimeMillis() - startTime);
+        if (originalRequestMap.metrics != null) {
+            originalRequestMap.metrics.recordServiceRate(1, System.currentTimeMillis() - startTime);
         }
     }