Java Code Examples for java.lang.management.ThreadInfo#getWaitedCount()
The following examples show how to use
java.lang.management.ThreadInfo#getWaitedCount() .
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: 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 2
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 3
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 4
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 5
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 6
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 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 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 9
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 10
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 11
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 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-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 14
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 15
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 16
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 17
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()); }