You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2013/12/11 11:37:10 UTC

[jira] [Comment Edited] (SLING-3277) RequestProcessorMBeanImpl.resetStatistics does not reset sum and squared sum variable values

    [ https://issues.apache.org/jira/browse/SLING-3277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13844345#comment-13844345 ] 

Bertrand Delacretaz edited comment on SLING-3277 at 12/11/13 10:37 AM:
-----------------------------------------------------------------------

Thanks for this report - would it be possible for you to supply a patch for the RequestProcessorMBeanImplTest, that reproduces your problem? We can then fix it and verify that your use case is covered.

[1]  https://svn.apache.org/repos/asf/sling/trunk/bundles/engine/src/test/java/org/apache/sling/engine/impl/RequestProcessorMBeanImplTest.java


was (Author: bdelacretaz):
Thanks for this report - would it be possible for you to supply a patch for the RequestProcessorMBeanImplTest, that reproduces your problem? We can then fix it and verify that your use case is covered.

(a patch for the RequestProcessorMBeanImpl would be welcome as well, of course ;-)

[1]  https://svn.apache.org/repos/asf/sling/trunk/bundles/engine/src/test/java/org/apache/sling/engine/impl/RequestProcessorMBeanImplTest.java

> RequestProcessorMBeanImpl.resetStatistics does not reset sum and squared sum variable values
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-3277
>                 URL: https://issues.apache.org/jira/browse/SLING-3277
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: Engine 2.2.10
>            Reporter: Francisco Chicharro
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>             Fix For: Engine 2.2.12
>
>         Attachments: RequestProcessorMBeanImpl.java, RequestProcessorMBeanImplTest.java
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)