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

Chetan Mehrotra commented on OAK-2755:
--------------------------------------

{quote}
IMO a better approach would register an MBean for the BackgroundObserver and/or 
one for the ChangeProcessor. The ConsolidatedListenerMBeanImpl could then just 
track those without any implementation dependencies. That MBean might then live 
in an utility/tooling package or even outside Oak. Such an approach would thus 
correctly separate the main concern of the involved classes from the monitoring 
concerns.
{quote}

Problem is currently only Observer instances are registered with the Service 
Registry. ChangeProcessor is wrapped by BackgroundObserver and that is then 
registered in SR. Thus its not possible to access the ChangeProcessor directly. 
Further to gather all the stats and relate them mbean needs
# EventListnerMBean instance
# Way to map it to backing observer as for each JCR MBean there is 1 backing 
observer
# If backing observer is BackgroundObserver then also access the queue stats. 
If not then queue stats would not be shown
# If original observer is ChangeProcessor then also get EventFilter details 
like interested in external or local
# Note that there are few (in our system 2) observer which are not related to 
JCR ObservationListener so for them only queue stats are shown (if possible)

All thos cast server the purpose of extracting important details _if possible_. 
Which IMO is fine for monitoring kind of logic.

> Consolidated JMX view of all EventListener related statistics
> -------------------------------------------------------------
>
>                 Key: OAK-2755
>                 URL: https://issues.apache.org/jira/browse/OAK-2755
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>              Labels: monitoring, observation
>             Fix For: 1.0.13, 1.3.0
>
>         Attachments: OAK-2755-2.patch, OAK-2755.patch, 
> consolidated-listener-stats-2.png, consolidated-listener-stats.png
>
>
> Oak Observation support exposes a {{EventListenerMBean}} [1] which provide 
> quite a bit of details around registered observation listeners. However in a 
> typical application there would be multiple listeners registered. To simplify 
> monitoring it would be helpful to have a _consolidated_ view of all listeners 
> related statistics.
> Further the stats can also include some more details which are Oak specific
> * Subtree paths to which the listener listens to - By default JCR Api allows 
> single path however Oak allows a listener to register to multiple paths
> * If listener is enabled to listen to cluster local and cluster external 
> changes
> * Size of queue in BackgroundObserver
> * Distribution of change types present in the queue - Local, External etc
> [1] 
> https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jmx/EventListenerMBean.java



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

Reply via email to