[
https://issues.apache.org/jira/browse/SOLR-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591506#action_12591506
]
Sean Timm commented on SOLR-539:
--------------------------------
Here is an illustration of the divide by zero bug. Notice the value of
avgRequestsPerSecond. This is two minutes after server start.
{code}
stats: requests : 4255
errors : 0
avgTimePerRequest : 196.68672
avgRequestsPerSecond : Infinity
{code}
> Statistics variable atomicity in RequestHandlerBase
> ---------------------------------------------------
>
> Key: SOLR-539
> URL: https://issues.apache.org/jira/browse/SOLR-539
> Project: Solr
> Issue Type: Bug
> Components: highlighter, search, spellchecker, update
> Affects Versions: 1.3
> Reporter: Sean Timm
> Priority: Minor
> Attachments: RequestHandlerBase-AtomicLong-stats.patch,
> RequestHandlerBase-volatile-stats.patch
>
>
> Writes are not atomic on longs unless they are volatile. At a minimum,
> numRequests, numErrors, and totalTime should be marked volatile. More
> correct, but higher overhead due to contention and synchronization would be
> to use AtomicLong.
> There is a minor error in the calculation of avgRequestsPerSecond. The first
> operand of the denominator is cast to a float then has a long subtracted from
> it, in effect casting both longs to floats then performing the subtraction.
> It is better to do the subtraction as longs then cast to a float.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.