Search in sources :

Example 1 with BackgroundObserverMBean

use of org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean in project jackrabbit-oak by apache.

the class ConsolidatedListenerMBeanImpl method getObserversStats.

@Override
public TabularData getObserversStats() {
    TabularDataSupport tds;
    try {
        int id = 0;
        TabularType tt = new TabularType(ObserverStatsData.class.getName(), "Consolidated Observer Stats", ObserverStatsData.TYPE, new String[] { "index" });
        tds = new TabularDataSupport(tt);
        for (BackgroundObserverMBean o : collectNonJcrObservers()) {
            tds.put(new ObserverStatsData(++id, o).toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) BackgroundObserverMBean(org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean)

Example 2 with BackgroundObserverMBean

use of org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean in project jackrabbit-oak by apache.

the class ObservationTest method getObservationQueueLength.

private static int[] getObservationQueueLength(@Nullable Whiteboard wb) {
    if (wb == null) {
        return new int[] { -1, -1 };
    }
    int len = -1;
    int ext = -1;
    for (BackgroundObserverMBean bean : getServices(wb, BackgroundObserverMBean.class)) {
        len = Math.max(bean.getQueueSize(), len);
        ext = Math.max(bean.getExternalEventCount(), ext);
    }
    return new int[] { len, ext };
}
Also used : BackgroundObserverMBean(org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean)

Aggregations

BackgroundObserverMBean (org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean)2 OpenDataException (javax.management.openmbean.OpenDataException)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1 TabularType (javax.management.openmbean.TabularType)1