jdk.jfr.consumer.RecordedThreadGroup Java Examples

The following examples show how to use jdk.jfr.consumer.RecordedThreadGroup. 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();
    }
}
 
Example #4
Source File: TestRecordedThreadGroupParent.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void assetrThreadGroupParents(ThreadGroup realGroup, RecordedThreadGroup recordedGroup) {
    if (recordedGroup == null && realGroup == null) {
        return; // root
    }
    Asserts.assertNotNull(recordedGroup, "Parent thread group should not be null");
    Asserts.assertEquals(realGroup.getName(), recordedGroup.getName(), "Parent thread group names don't match");
    assetrThreadGroupParents(realGroup.getParent(), recordedGroup.getParent());
}
 
Example #5
Source File: TestRecordedThreadGroupParent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void assetrThreadGroupParents(ThreadGroup realGroup, RecordedThreadGroup recordedGroup) {
    if (recordedGroup == null && realGroup == null) {
        return; // root
    }
    Asserts.assertNotNull(recordedGroup, "Parent thread group should not be null");
    Asserts.assertEquals(realGroup.getName(), recordedGroup.getName(), "Parent thread group names don't match");
    assetrThreadGroupParents(realGroup.getParent(), recordedGroup.getParent());
}
 
Example #6
Source File: TestRecordedThreadGroupParent.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void assetrThreadGroupParents(ThreadGroup realGroup, RecordedThreadGroup recordedGroup) {
    if (recordedGroup == null && realGroup == null) {
        return; // root
    }
    Asserts.assertNotNull(recordedGroup, "Parent thread group should not be null");
    Asserts.assertEquals(realGroup.getName(), recordedGroup.getName(), "Parent thread group names don't match");
    assetrThreadGroupParents(realGroup.getParent(), recordedGroup.getParent());
}