Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Engine 2.2.10
-
None
Description
The RequestProcessorMBeanImpl uses the variables: durationMsecSumX and durationMsecSumX2 to store the sum and squared sum of request durations. These variables are used later to calculate the statistics MeanRequestDurationMsec and StandardDeviationDurationMsec.
To calculate these statistics it uses the mentioned sum and sumX2 variables and the number of requests processed.
The issue arises when the resetStatistics method is invoked: it resets the number of processed requests to 0, but not the sum and squared sum variables.
For instance, if you have an accumulated processing time of 10000 msecs and 100 requests, the MeanRequestDurationMsec will be 100 msecs, which is correct.
If you invoke resetStatistics method at that time, the number of request will be reset to 0 while the sum of request durations will keep being 10000 msecs.
If next request is processed in 10msecs you will have accumulated a sum of request durations of 10010 msecs and only one request. So the MeanRequestDurationMsec statistic will display 10010msecs, which is wrong.
The same issue occurs with the statistics for ServletCallCount and PeakRecursionDepth.
To solve this issue the following variables need to be reset (set to 0) in the resetStatistics method:
- durationMsecSumX
- durationMsecSumX2
- servletCallCountSumX
- servletCallCountSumX2
- peakRecursionDepthSumX
- peakRecursionDepthSumX2