tpObj.put("active", threadPoolProxy.getActiveCount()); tpObj.put("pending", threadPoolProxy.getPendingTasks()); tpObj.put("completed", threadPoolProxy.getCompletedTasks());
/** * Gets number of repair sessions pending (repair on node has multiple repair sessions and by monitoring number of * pending repair sessions and active repair sessions we can monitor progress of repair). * * @return repair session info */ public long getRepairSessions() { long repairSessions = 0; Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> threads = nodeProbe.getThreadPoolMBeanProxies(); while (threads.hasNext()) { Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> thread = threads.next(); if (thread.getKey().equals(REPAIR_THREAD_POOL_NAME)) { JMXEnabledThreadPoolExecutorMBean threadPoolProxy = thread.getValue(); repairSessions = threadPoolProxy.getPendingTasks() + threadPoolProxy.getActiveCount(); } } return repairSessions; }
/** * Gets number of repair sessions pending (repair on node has multiple repair sessions and by monitoring number of * pending repair sessions and active repair sessions we can monitor progress of repair). * * @return repair session info */ public long getRepairSessions() { long repairSessions = 0; Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> threads = nodeProbe.getThreadPoolMBeanProxies(); while (threads.hasNext()) { Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> thread = threads.next(); if (thread.getKey().equals(REPAIR_THREAD_POOL_NAME)) { JMXEnabledThreadPoolExecutorMBean threadPoolProxy = thread.getValue(); repairSessions = threadPoolProxy.getPendingTasks() + threadPoolProxy.getActiveCount(); } } return repairSessions; }
/** * Get the status of all thread pools. * * @return thread pools info list */ public List<TPStatsInfo> getTPStats() { List<TPStatsInfo> tpstats = new ArrayList<>(); Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> threads = nodeProbe.getThreadPoolMBeanProxies(); while (threads.hasNext()) { Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> thread = threads.next(); JMXEnabledThreadPoolExecutorMBean threadPoolProxy = thread.getValue(); tpstats.add(new TPStatsInfo(thread.getKey(), threadPoolProxy.getActiveCount(), threadPoolProxy.getPendingTasks(), threadPoolProxy.getCompletedTasks(), threadPoolProxy.getCurrentlyBlockedTasks(), threadPoolProxy.getTotalBlockedTasks())); } return tpstats; }
@Override public void execute(NodeProbe probe) { System.out.printf("%-25s%10s%10s%15s%10s%18s%n", "Pool Name", "Active", "Pending", "Completed", "Blocked", "All time blocked"); Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> threads = probe.getThreadPoolMBeanProxies(); while (threads.hasNext()) { Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> thread = threads.next(); String poolName = thread.getKey(); JMXEnabledThreadPoolExecutorMBean threadPoolProxy = thread.getValue(); System.out.printf("%-25s%10s%10s%15s%10s%18s%n", poolName, threadPoolProxy.getActiveCount(), threadPoolProxy.getPendingTasks(), threadPoolProxy.getCompletedTasks(), threadPoolProxy.getCurrentlyBlockedTasks(), threadPoolProxy.getTotalBlockedTasks()); } System.out.printf("%n%-20s%10s%n", "Message type", "Dropped"); for (Map.Entry<String, Integer> entry : probe.getDroppedMessages().entrySet()) System.out.printf("%-20s%10s%n", entry.getKey(), entry.getValue()); } }
/** * Get the status of all thread pools. * * @return thread pools info list */ public List<TPStatsInfo> getTPStats() { List<TPStatsInfo> tpstats = new ArrayList<>(); Iterator<Map.Entry<String, JMXEnabledThreadPoolExecutorMBean>> threads = nodeProbe.getThreadPoolMBeanProxies(); while (threads.hasNext()) { Map.Entry<String, JMXEnabledThreadPoolExecutorMBean> thread = threads.next(); JMXEnabledThreadPoolExecutorMBean threadPoolProxy = thread.getValue(); tpstats.add(new TPStatsInfo(thread.getKey(), threadPoolProxy.getActiveCount(), threadPoolProxy.getPendingTasks(), threadPoolProxy.getCompletedTasks(), threadPoolProxy.getCurrentlyBlockedTasks(), threadPoolProxy.getTotalBlockedTasks())); } return tpstats; }
logger.info(String.format("%-25s%10s%10s%15s%10s%18s", poolName, threadPoolProxy.getActiveCount(), threadPoolProxy.getPendingTasks(), threadPoolProxy.getCompletedTasks(),