Author: fhanik
Date: Thu Oct  4 07:23:35 2007
New Revision: 581921

URL: http://svn.apache.org/viewvc?rev=581921&view=rev
Log:
fix request processing stats

Modified:
    tomcat/sandbox/gdev6x/java/org/apache/coyote/RequestInfo.java
    tomcat/sandbox/gdev6x/webapps/docs/changelog.xml

Modified: tomcat/sandbox/gdev6x/java/org/apache/coyote/RequestInfo.java
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/java/org/apache/coyote/RequestInfo.java?rev=581921&r1=581920&r2=581921&view=diff
==============================================================================
--- tomcat/sandbox/gdev6x/java/org/apache/coyote/RequestInfo.java (original)
+++ tomcat/sandbox/gdev6x/java/org/apache/coyote/RequestInfo.java Thu Oct  4 
07:23:35 2007
@@ -112,7 +112,8 @@
     }
 
     public long getRequestProcessingTime() {
-        return (System.currentTimeMillis() - req.getStartTime());
+        if ( getStage() == org.apache.coyote.Constants.STAGE_ENDED ) return 0;
+        else return (System.currentTimeMillis() - req.getStartTime());
     }
 
     // -------------------- Statistical data  --------------------
@@ -130,6 +131,9 @@
     private int requestCount;
     // number of response codes >= 400
     private int errorCount;
+    
+    //the time of the last request
+    private long lastRequestProcessingTime = 0;
 
 
     /** Called by the processor before recycling the request. It'll collect
@@ -145,6 +149,7 @@
         long t0=req.getStartTime();
         long t1=System.currentTimeMillis();
         long time=t1-t0;
+        this.lastRequestProcessingTime = time;
         processingTime+=time;
         if( maxTime < time ) {
             maxTime=time;
@@ -224,11 +229,19 @@
         return rpName;
     }
 
+    public long getLastRequestProcessingTime() {
+        return lastRequestProcessingTime;
+    }
+
     public void setWorkerThreadName(String workerThreadName) {
         this.workerThreadName = workerThreadName;
     }
 
     public void setRpName(ObjectName rpName) {
         this.rpName = rpName;
+    }
+
+    public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
+        this.lastRequestProcessingTime = lastRequestProcessingTime;
     }
 }

Modified: tomcat/sandbox/gdev6x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/sandbox/gdev6x/webapps/docs/changelog.xml?rev=581921&r1=581920&r2=581921&view=diff
==============================================================================
--- tomcat/sandbox/gdev6x/webapps/docs/changelog.xml (original)
+++ tomcat/sandbox/gdev6x/webapps/docs/changelog.xml Thu Oct  4 07:23:35 2007
@@ -17,6 +17,9 @@
 <body>
 <section name="Tomcat g6.xdev(unknown)">
   <subsection name="Catalina">
+    <fix><bug>43487</bug>
+      Fix request processing stats
+    </fix>  
     <update>
       Added in support for printing warning messages if invalid attributes are 
found (fhanik,remm)
       The following components are not covered



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to