Search in sources :

Example 11 with StackFrame

use of com.insightfullogic.honest_profiler.core.parser.StackFrame 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 12 with StackFrame

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

the class CallCountAggregator method toFlatProfileEntry.

private FlatProfileEntry toFlatProfileEntry(final T key, final CallCounts callCounts, final int traceCount) {
    int totalCount = callCounts.getTimeAppeared();
    int selfCount = callCounts.getTimeInvokingThis();
    Method method;
    final Long methodId = getMethodId.apply(key);
    method = methodByMethodId.get(methodId);
    if (method == null) {
        method = new Method(methodId, "UNKNOWN", "UNKNOWN", String.valueOf(methodId));
    }
    Frame frame;
    if (key instanceof StackFrame) {
        frame = new FullFrame(method, (StackFrame) key);
    } else {
        frame = method;
    }
    return new FlatProfileEntry(frame, totalCount, selfCount, traceCount);
}
Also used : StackFrame(com.insightfullogic.honest_profiler.core.parser.StackFrame) StackFrame(com.insightfullogic.honest_profiler.core.parser.StackFrame) Method(com.insightfullogic.honest_profiler.core.parser.Method)

Aggregations

StackFrame (com.insightfullogic.honest_profiler.core.parser.StackFrame)12 TraceStart (com.insightfullogic.honest_profiler.core.parser.TraceStart)7 Method (com.insightfullogic.honest_profiler.core.parser.Method)5 Test (org.junit.Test)4 ThreadMeta (com.insightfullogic.honest_profiler.core.parser.ThreadMeta)3 Profile (com.insightfullogic.honest_profiler.core.profiles.Profile)3 LeanNode (com.insightfullogic.honest_profiler.core.profiles.lean.LeanNode)2 LeanProfile (com.insightfullogic.honest_profiler.core.profiles.lean.LeanProfile)2 FrameInfo (com.insightfullogic.honest_profiler.core.profiles.lean.info.FrameInfo)2 MethodInfo (com.insightfullogic.honest_profiler.core.profiles.lean.info.MethodInfo)2 NumericInfo (com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo)2 ThreadInfo (com.insightfullogic.honest_profiler.core.profiles.lean.info.ThreadInfo)2 LeanLogCollectorDriver (com.insightfullogic.honest_profiler.framework.LeanLogCollectorDriver)2 BigInteger (java.math.BigInteger)2 Arrays.asList (java.util.Arrays.asList)2 Collections.reverse (java.util.Collections.reverse)2 List (java.util.List)2 Optional (java.util.Optional)2 Assert.assertEquals (org.junit.Assert.assertEquals)2 Assert.assertNotNull (org.junit.Assert.assertNotNull)2