Index: java/org/apache/coyote/RequestInfo.java =================================================================== --- java/org/apache/coyote/RequestInfo.java (revision 578847) +++ java/org/apache/coyote/RequestInfo.java (working copy) @@ -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; + } }