Java Code Examples for jdk.jfr.consumer.RecordedThreadGroup#getName()

The following examples show how to use jdk.jfr.consumer.RecordedThreadGroup#getName() . 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: Events.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private static void assertThread(RecordedThread eventThread, Thread thread) {
    assertNotNull(eventThread, "Thread in event was null");
    assertEquals(eventThread.getJavaThreadId(), thread.getId(), "Wrong thread id");
    assertEquals(eventThread.getJavaName(), thread.getName(), "Wrong thread name");

    ThreadGroup threadGroup = thread.getThreadGroup();
    RecordedThreadGroup eventThreadGroup = eventThread.getThreadGroup();
    assertNotNull(eventThreadGroup, "eventThreadGroup was null");

    // Iterate and check all threadGroups
    while (eventThreadGroup != null) {
        final String groupName = eventThreadGroup.getName();
        if (threadGroup != null) {
            assertEquals(groupName, threadGroup.getName(), "Wrong threadGroup name");
            threadGroup = threadGroup.getParent();
        } else {
            assertNotNull(groupName, "threadGroup name was null");
            assertFalse(groupName.isEmpty(), "threadGroup name was empty");
        }
        eventThreadGroup = eventThreadGroup.getParent();
    }
}
 
Example 2
Source File: Events.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static void assertThread(RecordedThread eventThread, Thread thread) {
    assertNotNull(eventThread, "Thread in event was null");
    assertEquals(eventThread.getJavaThreadId(), thread.getId(), "Wrong thread id");
    assertEquals(eventThread.getJavaName(), thread.getName(), "Wrong thread name");

    ThreadGroup threadGroup = thread.getThreadGroup();
    RecordedThreadGroup eventThreadGroup = eventThread.getThreadGroup();
    assertNotNull(eventThreadGroup, "eventThreadGroup was null");

    // Iterate and check all threadGroups
    while (eventThreadGroup != null) {
        final String groupName = eventThreadGroup.getName();
        if (threadGroup != null) {
            assertEquals(groupName, threadGroup.getName(), "Wrong threadGroup name");
            threadGroup = threadGroup.getParent();
        } else {
            assertNotNull(groupName, "threadGroup name was null");
            assertFalse(groupName.isEmpty(), "threadGroup name was empty");
        }
        eventThreadGroup = eventThreadGroup.getParent();
    }
}
 
Example 3
Source File: Events.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static void assertThread(RecordedThread eventThread, Thread thread) {
    assertNotNull(eventThread, "Thread in event was null");
    assertEquals(eventThread.getJavaThreadId(), thread.getId(), "Wrong thread id");
    assertEquals(eventThread.getJavaName(), thread.getName(), "Wrong thread name");

    ThreadGroup threadGroup = thread.getThreadGroup();
    RecordedThreadGroup eventThreadGroup = eventThread.getThreadGroup();
    assertNotNull(eventThreadGroup, "eventThreadGroup was null");

    // Iterate and check all threadGroups
    while (eventThreadGroup != null) {
        final String groupName = eventThreadGroup.getName();
        if (threadGroup != null) {
            assertEquals(groupName, threadGroup.getName(), "Wrong threadGroup name");
            threadGroup = threadGroup.getParent();
        } else {
            assertNotNull(groupName, "threadGroup name was null");
            assertFalse(groupName.isEmpty(), "threadGroup name was empty");
        }
        eventThreadGroup = eventThreadGroup.getParent();
    }
}