Java Code Examples for java.lang.management.ThreadInfo#getBlockedCount()
The following examples show how to use
java.lang.management.ThreadInfo#getBlockedCount() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThreadsTableModel.java From MtgDesktopCompanion with GNU General Public License v3.0 | 5 votes |
@Override public Object getValueAt(int row, int column) { ThreadInfo t = items.get(row); try { switch (column) { case 0: return t.getThreadId(); case 1: return t.getThreadName(); case 2: return ManagementFactory.getThreadMXBean().getThreadCpuTime(t.getThreadId())/(1e+9); case 3: return t.getThreadState().name(); case 4: return 1; case 5: return t.getLockInfo(); case 6: return t.getBlockedCount(); case 7: return Arrays.asList(ManagementFactory.getThreadMXBean().findDeadlockedThreads()).contains(t.getThreadId()); case 8 : return ((com.sun.management.ThreadMXBean)ManagementFactory.getThreadMXBean()).getThreadAllocatedBytes(t.getThreadId())/1024; default: return null; } } catch (Exception e) { logger.error("error get value :" + row+"/"+column,e); return null; } }
Example 2
Source File: HotThreads.java From Elasticsearch with Apache License 2.0 | 5 votes |
MyThreadInfo(long cpuTime, ThreadInfo info) { blockedCount = info.getBlockedCount(); blockedTime = info.getBlockedTime(); waitedCount = info.getWaitedCount(); waitedTime = info.getWaitedTime(); this.cpuTime = cpuTime; this.info = info; }
Example 3
Source File: HotThreads.java From Elasticsearch with Apache License 2.0 | 5 votes |
void setDelta(long cpuTime, ThreadInfo info) { if (deltaDone) throw new IllegalStateException("setDelta already called once"); blockedCount = info.getBlockedCount() - blockedCount; blockedTime = info.getBlockedTime() - blockedTime; waitedCount = info.getWaitedCount() - waitedCount; waitedTime = info.getWaitedTime() - waitedTime; this.cpuTime = cpuTime - this.cpuTime; deltaDone = true; this.info = info; }
Example 4
Source File: ThreadInfoCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 5
Source File: ThreadProcessUtils.java From clearpool with GNU General Public License v3.0 | 4 votes |
public static void realProcess(final DataSource dataSource, String name, final int loop, int threadCount, final AtomicLong physicalConnStat, final String sql) throws Exception { final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch endLatch = new CountDownLatch(threadCount); final CountDownLatch dumpLatch = new CountDownLatch(1); Thread[] threads = new Thread[threadCount]; for (int i = 0; i < threadCount; ++i) { Thread thread = new Thread() { @Override public void run() { try { startLatch.await(); for (int i = 0; i < loop; i++) { Connection conn = dataSource.getConnection(); if (sql != null) { PreparedStatement pstm = conn.prepareStatement(sql); pstm.execute(); pstm.close(); } conn.close(); } } catch (Exception ex) { ex.printStackTrace(); } endLatch.countDown(); try { dumpLatch.await(); } catch (InterruptedException e) { e.printStackTrace(); } } }; threads[i] = thread; thread.start(); } long startYGC = GCUtils.getYoungGC(); long startFullGC = GCUtils.getFullGC(); long startMillis = System.currentTimeMillis(); startLatch.countDown(); endLatch.await(); long millis = System.currentTimeMillis() - startMillis; long ygc = GCUtils.getYoungGC() - startYGC; long fullGC = GCUtils.getFullGC() - startFullGC; long[] threadIdArray = new long[threads.length]; for (int i = 0; i < threads.length; ++i) { threadIdArray[i] = threads[i].getId(); } ThreadInfo[] threadInfoArray = ManagementFactory.getThreadMXBean().getThreadInfo(threadIdArray); dumpLatch.countDown(); long blockedCount = 0; long waitedCount = 0; for (int i = 0; i < threadInfoArray.length; ++i) { ThreadInfo threadInfo = threadInfoArray[i]; blockedCount += threadInfo.getBlockedCount(); waitedCount += threadInfo.getWaitedCount(); } System.out.println("thread " + threadCount + " " + name + " millis : " + NumberFormat.getInstance().format(millis) + "; YGC " + ygc + "; FGC " + fullGC + "; blocked " + NumberFormat.getInstance().format(blockedCount) + "; waited " + NumberFormat.getInstance().format(waitedCount) + (physicalConnStat == null ? "" : "; physicalConn " + physicalConnStat.get()) + ";"); }
Example 6
Source File: ThreadInfoCompositeData.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 7
Source File: ThreadInfoCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 8
Source File: ThreadInfoCompositeData.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 9
Source File: ThreadInfoCompositeData.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 10
Source File: ThreadInfoCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 11
Source File: ThreadInfoCompositeData.java From hottub with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 12
Source File: ThreadInfoCompositeData.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 13
Source File: ThreadInfoCompositeData.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } if (!values[DAEMON].equals(info.isDaemon())) { throw new RuntimeException("Daemon = " + info.isDaemon() + " expected = " + values[DAEMON]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 14
Source File: ThreadInfoCompositeData.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 15
Source File: ThreadInfoCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 16
Source File: ThreadInfoCompositeData.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 17
Source File: ThreadInfoCompositeData.java From native-obfuscator with GNU General Public License v3.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }
Example 18
Source File: ThreadInfoCompositeData.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
static void checkThreadInfo(ThreadInfo info) throws Exception { if (info.getThreadId() != ((Long) values[THREAD_ID]).longValue()) { throw new RuntimeException("Thread Id = " + info.getThreadId() + " expected = " + values[THREAD_ID]); } if (!info.getThreadName().equals(values[THREAD_NAME])) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + values[THREAD_NAME]); } if (info.getThreadState() != Thread.State.RUNNABLE) { throw new RuntimeException("Thread Name = " + info.getThreadName() + " expected = " + Thread.State.RUNNABLE); } if (info.getBlockedTime() != ((Long) values[BLOCKED_TIME]).longValue()) { throw new RuntimeException("blocked time = " + info.getBlockedTime() + " expected = " + values[BLOCKED_TIME]); } if (info.getBlockedCount() != ((Long) values[BLOCKED_COUNT]).longValue()) { throw new RuntimeException("blocked count = " + info.getBlockedCount() + " expected = " + values[BLOCKED_COUNT]); } if (info.getWaitedTime() != ((Long) values[WAITED_TIME]).longValue()) { throw new RuntimeException("waited time = " + info.getWaitedTime() + " expected = " + values[WAITED_TIME]); } if (info.getWaitedCount() != ((Long) values[WAITED_COUNT]).longValue()) { throw new RuntimeException("waited count = " + info.getWaitedCount() + " expected = " + values[WAITED_COUNT]); } if (!info.getLockName().equals(values[LOCK_NAME])) { throw new RuntimeException("Lock Name = " + info.getLockName() + " expected = " + values[LOCK_NAME]); } if (info.getLockOwnerId() != ((Long) values[LOCK_OWNER_ID]).longValue()) { throw new RuntimeException( "LockOwner Id = " + info.getLockOwnerId() + " expected = " + values[LOCK_OWNER_ID]); } if (!info.getLockOwnerName().equals(values[LOCK_OWNER_NAME])) { throw new RuntimeException("LockOwner Name = " + info.getLockOwnerName() + " expected = " + values[LOCK_OWNER_NAME]); } checkStackTrace(info.getStackTrace()); checkLockInfo(info.getLockInfo()); }