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;
}
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 };
}
Aggregations