当前位置: 首页>>代码示例>>Java>>正文


Java ThreadInfo.getBlockedCount方法代码示例

本文整理汇总了Java中java.lang.management.ThreadInfo.getBlockedCount方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadInfo.getBlockedCount方法的具体用法?Java ThreadInfo.getBlockedCount怎么用?Java ThreadInfo.getBlockedCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.lang.management.ThreadInfo的用法示例。


在下文中一共展示了ThreadInfo.getBlockedCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MyThreadInfo

import java.lang.management.ThreadInfo; //导入方法依赖的package包/类
MyThreadInfo(long cpuTime, ThreadInfo info) {
    blockedCount = info.getBlockedCount();
    blockedTime = info.getBlockedTime();
    waitedCount = info.getWaitedCount();
    waitedTime = info.getWaitedTime();
    this.cpuTime = cpuTime;
    this.info = info;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:HotThreads.java

示例2: setDelta

import java.lang.management.ThreadInfo; //导入方法依赖的package包/类
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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:HotThreads.java

示例3: checkThreadInfo

import java.lang.management.ThreadInfo; //导入方法依赖的package包/类
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());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:54,代码来源:ThreadInfoCompositeData.java

示例4: checkThreadInfo

import java.lang.management.ThreadInfo; //导入方法依赖的package包/类
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());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:59,代码来源:ThreadInfoCompositeData.java


注:本文中的java.lang.management.ThreadInfo.getBlockedCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。