Search in sources :

Example 1 with FlameGraph

use of com.insightfullogic.honest_profiler.core.profiles.FlameGraph 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)1 FlameTrace (com.insightfullogic.honest_profiler.core.profiles.FlameTrace)1 LogSource (com.insightfullogic.honest_profiler.core.sources.LogSource)1 FileLogSource (com.insightfullogic.honest_profiler.ports.sources.FileLogSource)1