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

Chetan Mehrotra edited comment on OAK-3478 at 11/18/15 6:52 AM:
----------------------------------------------------------------

[first patch|^OAK-3478-v1.patch] which implements approach #2 above

It introduces a {{TimeSeriesExporterMBean}} bean which wraps any existing MBean 
and exposes the last second data of various time series attributes in simple 
long form. Its a DynamicMBean where attribute information is generated 
programatically

*Usage*

To expose a TimeSeries data in simple form just mark the attribute with an 
annotation
{code:java}
import org.apache.jackrabbit.oak.commons.jmx.DataType;

import static org.apache.jackrabbit.oak.commons.jmx.DataTypeOption.TIME_SERIES;

public interface RepositoryStatsMBean {
    @DataType(TIME_SERIES)
    CompositeData getSessionCount();

    ...
}
{code}

Once annotated then WhiteboardUtils would check if the MBean being registered 
has a time series data. If yes then it registers another mbean which just 
expose the simpler form of time series data

*Open Item*
# New Mbean naming - Currently the patch just appends "-simple" to the name of 
original mbean as a quick change. Probably we should change the type
# Current logic just picks the first element of  {{per second}} array of 
TimeSeries CompositeData. This should be fine but need opinion from others

[~ianeboston] [~mduerig] Can you review the proposed approach.

[~ianeboston] - If you can give this a try on your setup and provide some 
feedback that would be helpful to determine if proposed solution meets the 
requirement or not



was (Author: chetanm):
[first patch|^OAK-3478-v1.patch] which implements approach #2 above

It introduces a {{TimeSeriesExporterMBean}} bean which wraps any existing MBean 
and exposes the last second data of various time series attributes in simple 
long form. Its a DynamicMBean where attribute information is generated 
programatically

*Usage*

To expose a TimeSeries data in simple form just mark the attribute with an 
annotation
{code:java}
import org.apache.jackrabbit.oak.commons.jmx.DataType;

import static org.apache.jackrabbit.oak.commons.jmx.DataTypeOption.TIME_SERIES;

public interface RepositoryStatsMBean {
    @DataType(TIME_SERIES)
    CompositeData getSessionCount();

    ...
}
{code}

Once annotated then WhiteboardUtils would check if the MBean being registered 
has a time series data. If yes then it registers another mbean which just 
expose the simpler form of time series data

*Open Item*
# New Mbean naming - Currently the patch just appends "-simple" to the name of 
original mbean as a quick change. Probably we should change the type

[~ianeboston] [~mduerig] Can you review the proposed approach.

[~ianeboston] - If you can give this a try on your setup and provide some 
feedback that would be helpful to determine if proposed solution meets the 
requirement or not


> Provide JMX Beans for Oak that can be monitored by external tooling.
> --------------------------------------------------------------------
>
>                 Key: OAK-3478
>                 URL: https://issues.apache.org/jira/browse/OAK-3478
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, jcr, lucene, query
>    Affects Versions: 1.3.7
>            Reporter: Ian Boston
>            Assignee: Chetan Mehrotra
>             Fix For: 1.3.11
>
>         Attachments: OAK-3478-v1.patch
>
>
> The Current JMX beans, while ok in the Sling Web Console are hard if not 
> impossible to monitor with external tooling, as external tooling will poll 
> for current values, ideally from named attributes containing primitive types. 
> Those values containing timers, counters or gauges. Timers timing an 
> operation. Counters counting an operation. Guages measuring an instantaneous 
> value.
> The request is to provide a small number of JMX beans that can be configured 
> into an external monitoring tool like AppDynamics, Ganglia, NewRelic, Splunk 
> etc etc, which in turn will provide long term time series and statistics. 
> Primitive values of this form can also be graphed with ease in JConsole, 
> VisualVM etc. A improvement for the Sling Web Console might be to add a 
> Console that can maintain a TimeSeries graph of any JMX bean by object name 
> in the same way Ganglia, AppDynamics does, however that may be duplicating 
> existing functionality.
> The Metrics Library could be considered to provide the above functionality 
> for all JMX beans and monitoring, although its footprint at 111K might be 
> considered too big as an additional dependency.



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

Reply via email to