private boolean isBulkProcessorAvailable() { NodesStatsResponse response = client.admin().cluster().prepareNodesStats().setThreadPool(true).get(); for (NodeStats nodeStats : response.getNodes()) { Iterator<Stats> iterator = nodeStats.getThreadPool().iterator(); while (iterator.hasNext()) { Stats stats = iterator.next(); if ("bulk".equals(stats.getName())) { int queue = stats.getQueue(); logger.trace("bulkQueueSize [{}] - queue [{}] - availability [{}]", bulkQueueSize, queue, 1 - (queue / bulkQueueSize)); return 1 - (queue / bulkQueueSize) > 0.1; } } } return true; }
table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); table.addCell(poolStats == null ? null : poolStats.getQueue()); table.addCell(maxQueueSize == null ? -1 : maxQueueSize); table.addCell(poolStats == null ? null : poolStats.getRejected());
final NodesStatsResponse response = client.admin().cluster().prepareNodesStats().setThreadPool(true).execute().actionGet(); final NodeStats[] nodeStats2 = response.getNodes(); for (NodeStats nodeStats3 : nodeStats2) { ThreadPoolStats stats = nodeStats3.getThreadPool(); if (stats != null) for (ThreadPoolStats.Stats threadPoolStat : stats) { System.out.println("node `" + nodeStats3.getNode().getName() + "`" + " has pool `" + threadPoolStat.getName() + "` with current queue size " + threadPoolStat.getQueue()); } }
table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); table.addCell(poolStats == null ? null : poolStats.getQueue()); table.addCell(maxQueueSize == null ? -1 : maxQueueSize); table.addCell(poolStats == null ? null : poolStats.getRejected());
table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); table.addCell(poolStats == null ? null : poolStats.getQueue()); table.addCell(maxQueueSize == null ? -1 : maxQueueSize); table.addCell(poolStats == null ? null : poolStats.getRejected());
table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); table.addCell(poolStats == null ? null : poolStats.getQueue()); table.addCell(maxQueueSize); table.addCell(poolStats == null ? null : poolStats.getRejected());
table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); table.addCell(poolStats == null ? null : poolStats.getQueue()); table.addCell(maxQueueSize); table.addCell(poolStats == null ? null : poolStats.getRejected());
if( stat.getName().equals("index") ) { tpStatsBean.indexThreads = stat.getThreads(); tpStatsBean.indexQueue = stat.getQueue(); tpStatsBean.indexActive = stat.getActive(); tpStatsBean.indexRejected = stat.getRejected(); tpStatsBean.getQueue = stat.getQueue(); tpStatsBean.getActive = stat.getActive(); tpStatsBean.getRejected = stat.getRejected(); tpStatsBean.searchQueue = stat.getQueue(); tpStatsBean.searchActive = stat.getActive(); tpStatsBean.searchRejected = stat.getRejected(); tpStatsBean.bulkQueue = stat.getQueue(); tpStatsBean.bulkActive = stat.getActive(); tpStatsBean.bulkRejected = stat.getRejected();
private void sendNodeThreadPoolStats(ThreadPoolStats threadPoolStats) { String type = buildMetricName("node.threadpool"); Iterator<ThreadPoolStats.Stats> statsIterator = threadPoolStats.iterator(); while (statsIterator.hasNext()) { ThreadPoolStats.Stats stats = statsIterator.next(); String id = type + "." + stats.getName(); sendInt(id, "threads", stats.getThreads()); sendInt(id, "queue", stats.getQueue()); sendInt(id, "active", stats.getActive()); sendInt(id, "rejected", stats.getRejected()); sendInt(id, "largest", stats.getLargest()); sendInt(id, "completed", stats.getCompleted()); } }