use of org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean in project jackrabbit-oak by apache.
the class AsyncIndexInfoServiceImpl method getInfo.
@Override
public AsyncIndexInfo getInfo(String name, NodeState root) {
NodeState async = getAsyncState(root);
if (async.hasProperty(name)) {
long lastIndexedTo = getLastIndexedTo(name, async);
long leaseEnd = -1;
boolean running = false;
if (async.hasProperty(AsyncIndexUpdate.leasify(name))) {
running = true;
leaseEnd = async.getLong(AsyncIndexUpdate.leasify(name));
}
IndexStatsMBean mbean = statsMBeans.get(name);
return new AsyncIndexInfo(name, lastIndexedTo, leaseEnd, running, mbean);
}
return null;
}
use of org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean in project jackrabbit-oak by apache.
the class SimpleToken method getIndexStatsMBean.
private IndexStatsMBean getIndexStatsMBean(String asyncIndexerLane) {
AsyncIndexInfo info = infoService.getInfo(asyncIndexerLane);
checkNotNull(info, "No AsyncIndexInfo found for lane [%s]", asyncIndexerLane);
IndexStatsMBean mbean = info.getStatsMBean();
return checkNotNull(mbean, "No IndexStatsMBean associated with [%s]", asyncIndexerLane);
}
use of org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean in project jackrabbit-oak by apache.
the class HybridIndexTest method dumpStats.
private void dumpStats() {
IndexStatsMBean indexStats = WhiteboardUtils.getService(whiteboard, IndexStatsMBean.class);
System.out.println(indexStats.getConsolidatedExecutionStats());
String queueSize = Arrays.toString(statsProvider.getStats().getTimeSeries("HYBRID_QUEUE_SIZE", false).getValuePerSecond());
System.out.println("Queue size - " + queueSize);
}
use of org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean in project jackrabbit-oak by apache.
the class ScalabilityNodeSuite method waitBeforeIterationFinish.
protected void waitBeforeIterationFinish(long loadFinish) {
IndexStatsMBean indexStatsMBean = WhiteboardUtils.getService(whiteboard, IndexStatsMBean.class);
if (indexStatsMBean != null) {
String lastIndexedTime = indexStatsMBean.getLastIndexedTime();
while (((lastIndexedTime == null) || ISO8601.parse(lastIndexedTime).getTimeInMillis() < loadFinish)) {
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Waiting for async indexing to finish");
}
Thread.sleep(5000);
} catch (InterruptedException e) {
LOG.error("Error waiting for async index to finish", e);
}
lastIndexedTime = indexStatsMBean.getLastIndexedTime();
}
LOG.info("Execution Count {}", indexStatsMBean.getExecutionCount());
LOG.info("Execution Time {}", indexStatsMBean.getExecutionTime());
LOG.info("Consolidated Execution Stats {}", indexStatsMBean.getConsolidatedExecutionStats());
}
}
use of org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean in project jackrabbit-oak by apache.
the class IndexPrinter method printAsyncIndexInfo.
private void printAsyncIndexInfo(PrintWriter pw) {
List<String> asyncLanes = ImmutableList.copyOf(asyncIndexInfoService.getAsyncLanes());
String title = "Async Indexers State";
printTitle(pw, title);
pw.printf("Number of async indexer lanes : %d%n", asyncLanes.size());
pw.println();
for (String lane : asyncLanes) {
pw.println(lane);
AsyncIndexInfo info = asyncIndexInfoService.getInfo(lane);
if (info != null) {
pw.printf(" Last indexed to : %s%n", formatTime(info.getLastIndexedTo()));
IndexStatsMBean stats = info.getStatsMBean();
if (stats != null) {
pw.printf(" Status : %s%n", stats.getStatus());
pw.printf(" Failing : %s%n", stats.isFailing());
pw.printf(" Paused : %s%n", stats.isPaused());
if (stats.isFailing()) {
pw.printf(" Failing since : %s%n", stats.getFailingSince());
pw.printf(" Latest error : %s%n", stats.getLatestError());
}
}
pw.println();
}
}
}
Aggregations