[ 
https://issues.apache.org/jira/browse/OAK-863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chetan Mehrotra updated OAK-863:
--------------------------------

    Attachment: OAK-863-2.patch

Thanks Jukka for the suggestion. Attached is the updated patch (OAK-863-2.patch 
and [1]). 

* Added a new {{CacheStats}} class for Oak in 
{{org.apache.jackrabbit.oak.cache}} package. It exposes some extra information 
over and above Guava CacheStats
* Currently the code only registers the JMX beans in OSGi env

[1] https://github.com/chetanmeh/jackrabbit-oak/compare/trunk...OAK-863-2
                
> Enable stats for various caches used in Oak by default
> ------------------------------------------------------
>
>                 Key: OAK-863
>                 URL: https://issues.apache.org/jira/browse/OAK-863
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>         Attachments: cache-stats.png, OAK-863-1.patch, OAK-863-2.patch
>
>
> To get a better picture around the usage of cache it would be helpful to 
> enable the 
> [statistics|http://code.google.com/p/guava-libraries/wiki/CachesExplained#Statistics]
>  for various caches used in Oak
> {code:java}
> nodeCache = CacheBuilder.newBuilder()
>                         .weigher(...)
>                         .maximumWeight(...)
>                         .recordStats()
>                         .build();
> {code}
> Once enabled it allows to get stats like below
> {noformat}
> CacheStats{hitCount=763322, missCount=51333, loadSuccessCount=0, 
> loadExceptionCount=0, totalLoadTime=0, evictionCount=3496}
> {noformat}
> As stats collection adds a very minor overhead we can look into making this 
> setting configurable. 
> Untill we expose the stats via JMX one can extract the value in Sling env via 
> approach mentioned in [this gist|https://gist.github.com/chetanmeh/5748650]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to