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);
}
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);
}
}
}
Aggregations