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));
}
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);
}
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());
}
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);
}
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");
}
Aggregations