Search in sources :

Example 1 with FlatProfileEntry

use of com.insightfullogic.honest_profiler.core.collector.FlatProfileEntry 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)

Example 2 with FlatProfileEntry

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

the class ProfileViewTest method rendersSingleMethod.

@Test
public void rendersSingleMethod() {
    ProfileNode root = new ProfileNode(ProfileFixtures.printf, 1, 1);
    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.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

FlatProfileEntry (com.insightfullogic.honest_profiler.core.collector.FlatProfileEntry)2 Profile (com.insightfullogic.honest_profiler.core.profiles.Profile)2 ProfileNode (com.insightfullogic.honest_profiler.core.profiles.ProfileNode)2 Test (org.junit.Test)2