Author: remy.maucherat(a)jboss.com
Date: 2007-10-05 09:36:59 -0400 (Fri, 05 Oct 2007)
New Revision: 297
Modified:
trunk/java/org/apache/coyote/RequestInfo.java
trunk/webapps/docs/changelog.xml
Log:
- Fixes to request processing time.
Modified: trunk/java/org/apache/coyote/RequestInfo.java
===================================================================
--- trunk/java/org/apache/coyote/RequestInfo.java 2007-10-03 16:14:59 UTC (rev 296)
+++ trunk/java/org/apache/coyote/RequestInfo.java 2007-10-05 13:36:59 UTC (rev 297)
@@ -52,7 +52,7 @@
this.global=global;
global.addRequestProcessor( this );
} else {
- if (this.global != null) {
+ if (this.global != null) {
this.global.removeRequestProcessor( this );
this.global = null;
}
@@ -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,6 +229,10 @@
return rpName;
}
+ public long getLastRequestProcessingTime() {
+ return lastRequestProcessingTime;
+ }
+
public void setWorkerThreadName(String workerThreadName) {
this.workerThreadName = workerThreadName;
}
@@ -231,4 +240,8 @@
public void setRpName(ObjectName rpName) {
this.rpName = rpName;
}
+
+ public void setLastRequestProcessingTime(long lastRequestProcessingTime) {
+ this.lastRequestProcessingTime = lastRequestProcessingTime;
+ }
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2007-10-03 16:14:59 UTC (rev 296)
+++ trunk/webapps/docs/changelog.xml 2007-10-05 13:36:59 UTC (rev 297)
@@ -117,6 +117,9 @@
<fix>
o.a.juli.ClassLoaderLogManager handle more then one system property replacement
at file logging.properties. (pero)
</fix>
+ <fix>
+ <bug>43487</bug>: Fix request processing stats. (fhanik)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -136,6 +139,9 @@
<bug>37326</bug>: No error reported when an included page does not
exist. (markt)
</fix>
+ <fix>
+ <bug>41797</bug>: CNFE/NPE thrown from function mapper when
externalizing, submitted by Tuomas Kiviaho. (funkman)
+ </fix>
</changelog>
</subsection>
<subsection name="Webapps">
Show replies by date