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); }
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()); } }