ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream(stream, true);
ProjectStats stats = bugCollection.getProjectStats();
printToStream("\nFootprint: " + new Footprint(stats.getBaseFootprint()).toString());
Profiler profiler = stats.getProfiler();
PrintStream printStream;
try {
printStream = new PrintStream(stream, false, "UTF-8");
} catch (UnsupportedEncodingException e1) {
// can never happen with UTF-8
return;
}
printToStream("\nTotal time:");
profiler.report(new Profiler.TotalTimeComparator(profiler), new Profiler.FilterByTime(10000000), printStream);
printToStream("\nTotal calls:");
profiler.report(new Profiler.TotalCallsComparator(profiler), new Profiler.FilterByCalls(stats.getNumClasses()),
printStream);
printToStream("\nTime per call:");
profiler.report(new Profiler.TimePerCallComparator(profiler),
new Profiler.FilterByTimePerCall(10000000 / stats.getNumClasses()), printStream);
try {
xmlStream.finish();
} catch (IOException e) {
FindbugsPlugin.getDefault().logException(e, "Print to console failed");