Search in sources :

Example 1 with LeanThreadNode

use of com.insightfullogic.honest_profiler.core.profiles.lean.LeanThreadNode in project honest-profiler by jvm-profiling-tools.

the class AggregationProfileTest method checkThreadInfoLogic.

@Test
public void checkThreadInfoLogic() {
    LeanProfileGenerator gen = new LeanProfileGenerator();
    SCENARIOS.get(7).executeAndEnd(gen);
    LeanProfile leanProfile = gen.getProfile();
    for (LeanThreadNode threadNode : leanProfile.getThreads().values()) {
        assertNull(threadNode.getThreadInfo());
    }
    AggregationProfile profile = new AggregationProfile(leanProfile);
    Map<Long, LeanThreadNode> threads = profile.getSource().getThreads();
    // Check ThreadInfo has been updated
    assertNotNull("Missing ThreadInfo for thread 1", threads.get(1L).getThreadInfo());
    assertNotNull("Missing ThreadInfo for thread 2", threads.get(2L).getThreadInfo());
    assertNotNull("Missing ThreadInfo for thread 3", threads.get(3L).getThreadInfo());
    assertNotNull("Missing ThreadInfo for thread 4", threads.get(4L).getThreadInfo());
    assertNotNull("Missing ThreadInfo for thread 5", threads.get(5L).getThreadInfo());
    assertNull("There should be no ThreadInfo for thread 6", threads.get(6L).getThreadInfo());
}
Also used : LeanProfileGenerator(com.insightfullogic.honest_profiler.framework.generator.LeanProfileGenerator) LeanProfile(com.insightfullogic.honest_profiler.core.profiles.lean.LeanProfile) LeanThreadNode(com.insightfullogic.honest_profiler.core.profiles.lean.LeanThreadNode) Test(org.junit.Test)

Aggregations

LeanProfile (com.insightfullogic.honest_profiler.core.profiles.lean.LeanProfile)1 LeanThreadNode (com.insightfullogic.honest_profiler.core.profiles.lean.LeanThreadNode)1 LeanProfileGenerator (com.insightfullogic.honest_profiler.framework.generator.LeanProfileGenerator)1 Test (org.junit.Test)1