Search in sources :

Example 1 with ProfileNode

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

the class ProfileTreeTest method sortsSiblingsWithinTreeView.

@Test
public void sortsSiblingsWithinTreeView() {
    printlnCallingAppend(1);
    printlnCallingPrintf(1);
    printlnCallingPrintf(1);
    collector.endOfLog();
    ProfileNode rootNode = getTrees().get(0).getRootNode();
    assertNode(ProfileFixtures.println, 1.0, rootNode);
    List<ProfileNode> children = rootNode.getChildren();
    assertNode(ProfileFixtures.printf, 2.0 / 3, children.get(0));
    assertNode(ProfileFixtures.append, 1.0 / 3, children.get(1));
}
Also used : ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) Test(org.junit.Test)

Example 2 with ProfileNode

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

the class ProfileTreeTest method collectsSplitMethods.

@Test
public void collectsSplitMethods() {
    printlnCallingPrintfAndAppend(1);
    collector.endOfLog();
    ProfileNode node = assertProfileHasSingleTree();
    assertPrintlnCallingAppendAndPrintf(node);
}
Also used : ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) Test(org.junit.Test)

Example 3 with ProfileNode

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

the class ProfileTreeTest method collectsTwoNodesIntoATree.

@Test
public void collectsTwoNodesIntoATree() {
    printlnCallingAppend(1);
    collector.endOfLog();
    ProfileNode node = assertProfileHasSingleTree();
    assertEquals(1L, node.children().count());
    assertNode(ProfileFixtures.println, 1.0, node);
    assertNode(ProfileFixtures.append, 1.0, node.children().findFirst().get());
}
Also used : ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) Test(org.junit.Test)

Example 4 with ProfileNode

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

the class ProfileTreeTest method rendersSingleNode.

@Test
public void rendersSingleNode() {
    collector.handle(new TraceStart(1, 1, 0L, 0L));
    collector.handle(new StackFrame(20, ProfileFixtures.printlnId));
    collector.handle(ProfileFixtures.println);
    collector.endOfLog();
    ProfileNode node = assertProfileHasSingleTree();
    assertEquals(0L, node.children().count());
    assertNode(ProfileFixtures.println, 1.0, node);
}
Also used : TraceStart(com.insightfullogic.honest_profiler.core.parser.TraceStart) ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) StackFrame(com.insightfullogic.honest_profiler.core.parser.StackFrame) Test(org.junit.Test)

Example 5 with ProfileNode

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

the class ProfileViewTest method rendersMultiBranchProfile.

@Test
public void rendersMultiBranchProfile() {
    ProfileNode left = new ProfileNode(ProfileFixtures.println, 1, 2);
    ProfileNode right = new ProfileNode(ProfileFixtures.append, 1, 2);
    ProfileNode root = new ProfileNode(ProfileFixtures.printf, 1, 1, asList(left, right));
    Profile profile = new Profile(2, asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), asList(new FlatProfileEntry(ProfileFixtures.printf, 1, 0, 1)), toTrees(root));
    ui.accept(profile);
    console.isShowingTraces(2);
    console.displaysMethod(ProfileFixtures.printf);
    console.displaysMethod(ProfileFixtures.append);
    console.displaysMethod(ProfileFixtures.println);
    console.outputContains("50.0");
    console.outputContains("100.0");
}
Also used : ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) FlatProfileEntry(com.insightfullogic.honest_profiler.core.collector.FlatProfileEntry) Profile(com.insightfullogic.honest_profiler.core.profiles.Profile) Test(org.junit.Test)

Aggregations

ProfileNode (com.insightfullogic.honest_profiler.core.profiles.ProfileNode)7 Test (org.junit.Test)6 FlatProfileEntry (com.insightfullogic.honest_profiler.core.collector.FlatProfileEntry)2 Profile (com.insightfullogic.honest_profiler.core.profiles.Profile)2 Method (com.insightfullogic.honest_profiler.core.parser.Method)1 StackFrame (com.insightfullogic.honest_profiler.core.parser.StackFrame)1 TraceStart (com.insightfullogic.honest_profiler.core.parser.TraceStart)1