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

Chetan Mehrotra commented on OAK-3823:
--------------------------------------

Introducing the count posed a problem for {{MeterStats}} as they are used in 
TimeSeries where the backing {{AtomicLong}} instance is reset on each second. 
So to honour the contract for {{count}} we would now have to manage our own 
counter in {{SimpleStats}}. However that would lead to usage of an extra 
{{AtomicLong}}. 

Generally this overhead is not of much concern (it is small) but it might have 
some impact in time critical operation like Session read. For such cases usage 
of [JDK 8 
LongAdder|https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html]
 would be better. For now minimized the impact by using a primitive long as in 
session read counter is increment by 1 (and not 'n')

Done with rev 1721509

> Expose the count maintained by various stats
> --------------------------------------------
>
>                 Key: OAK-3823
>                 URL: https://issues.apache.org/jira/browse/OAK-3823
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: core
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.3.13
>
>
> All Metric instance implement the {{Counting}} interface which exposes the 
> count for underlying metrics
> # Counter - Counter value
> # Meter - Sum of all mark calls
> # Timer - Number of times timer is invoked
> # Histrogram - Number of times timer is invoked
> This would avoid maintaining a duplicate sum variable for say maintaining the 
> sum of all data upload recorded in a meter



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to