Search in sources :

Example 6 with ProfileNode

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

Example 7 with ProfileNode

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

the class NodeCollector method normaliseBy.

private ProfileNode normaliseBy(int parentVisits, LongFunction<Method> nameRegistry) {
    Method method = nameRegistry.apply(methodId);
    List<ProfileNode> children = childrenByMethodId.values().stream().map(child -> child.normaliseBy(parentVisits, nameRegistry)).sorted(bySelfTimeShare).collect(toList());
    return new ProfileNode(method, visits, parentVisits, children);
}
Also used : ProfileNode(com.insightfullogic.honest_profiler.core.profiles.ProfileNode) Method(com.insightfullogic.honest_profiler.core.parser.Method)

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