Search in sources :

Example 1 with FlameTrace

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

the class FlameGraphCollector method addCurrentTrace.

private void addCurrentTrace() {
    if (currentMethodIds == null || currentMethodIds.size() == 0)
        return;
    if (lastMethodIds.equals(currentMethodIds)) {
        trace.incrementWeight();
        return;
    }
    List<Method> methods = currentMethodIds.stream().map(method -> this.methods.getOrDefault(method, unknownMethod)).collect(toList());
    trace = new FlameTrace(methods, 1);
    flameGraph.onNewTrace(trace);
}
Also used : FlameGraphListener(com.insightfullogic.honest_profiler.core.profiles.FlameGraphListener) TraceStart(com.insightfullogic.honest_profiler.core.parser.TraceStart) Monitor(com.insightfullogic.honest_profiler.core.Monitor) StackFrame(com.insightfullogic.honest_profiler.core.parser.StackFrame) HashMap(java.util.HashMap) Method(com.insightfullogic.honest_profiler.core.parser.Method) ArrayList(java.util.ArrayList) FlameGraph(com.insightfullogic.honest_profiler.core.profiles.FlameGraph) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) FlameTrace(com.insightfullogic.honest_profiler.core.profiles.FlameTrace) LogEventListener(com.insightfullogic.honest_profiler.core.parser.LogEventListener) LogSource(com.insightfullogic.honest_profiler.core.sources.LogSource) ThreadMeta(com.insightfullogic.honest_profiler.core.parser.ThreadMeta) Map(java.util.Map) Box(com.insightfullogic.honest_profiler.core.Box) FlameTrace(com.insightfullogic.honest_profiler.core.profiles.FlameTrace) Method(com.insightfullogic.honest_profiler.core.parser.Method)

Example 2 with FlameTrace

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

the class FlameGraphDumperApplication method main.

public static void main(String[] args) throws Exception {
    if (args.length < 2) {
        System.out.print("Usage: java com.insightfullogic.honest_profiler.ports.console.FlameGraphApplication <profile.hpl> <profile.txt>\n" + "\n" + "The output needs to be processed with the tools at https://github.com/brendangregg/FlameGraph to produce the actual flamegraph\n");
        System.exit(1);
    }
    String in = args[0], out = args[1];
    LogSource source = new FileLogSource(new File(in));
    try (Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out)))) {
        FlameGraph data = FlameGraphCollector.readFlamegraph(source);
        for (FlameTrace trace : data.getTraces()) {
            writeTrace(output, trace);
        }
    }
}
Also used : FileLogSource(com.insightfullogic.honest_profiler.ports.sources.FileLogSource) LogSource(com.insightfullogic.honest_profiler.core.sources.LogSource) FileLogSource(com.insightfullogic.honest_profiler.ports.sources.FileLogSource) FlameTrace(com.insightfullogic.honest_profiler.core.profiles.FlameTrace) FlameGraph(com.insightfullogic.honest_profiler.core.profiles.FlameGraph)

Aggregations

FlameGraph (com.insightfullogic.honest_profiler.core.profiles.FlameGraph)2 FlameTrace (com.insightfullogic.honest_profiler.core.profiles.FlameTrace)2 LogSource (com.insightfullogic.honest_profiler.core.sources.LogSource)2 Box (com.insightfullogic.honest_profiler.core.Box)1 Monitor (com.insightfullogic.honest_profiler.core.Monitor)1 LogEventListener (com.insightfullogic.honest_profiler.core.parser.LogEventListener)1 Method (com.insightfullogic.honest_profiler.core.parser.Method)1 StackFrame (com.insightfullogic.honest_profiler.core.parser.StackFrame)1 ThreadMeta (com.insightfullogic.honest_profiler.core.parser.ThreadMeta)1 TraceStart (com.insightfullogic.honest_profiler.core.parser.TraceStart)1 FlameGraphListener (com.insightfullogic.honest_profiler.core.profiles.FlameGraphListener)1 FileLogSource (com.insightfullogic.honest_profiler.ports.sources.FileLogSource)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Collectors.toList (java.util.stream.Collectors.toList)1