Add special case for single-call functions in profiler::dump
This commit is contained in:
parent
5d023cb923
commit
f327cc4315
1 changed files with 11 additions and 6 deletions
|
|
@ -79,12 +79,17 @@ namespace psemek::util
|
|||
for (auto const & c : node.children)
|
||||
{
|
||||
auto const & stat = c.second.execution_time;
|
||||
log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first
|
||||
<< " avg " << pretty(stat.mean())
|
||||
<< " 25% " << pretty(stat.percentile(0.25))
|
||||
<< " 50% " << pretty(stat.percentile(0.50))
|
||||
<< " 75% " << pretty(stat.percentile(0.75))
|
||||
<< " (" << stat.count() << " calls)";
|
||||
if (stat.count() == 1)
|
||||
log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first
|
||||
<< " " << pretty(stat.mean())
|
||||
<< " (" << stat.count() << " call)";
|
||||
else
|
||||
log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first
|
||||
<< " avg " << pretty(stat.mean())
|
||||
<< " 25% " << pretty(stat.percentile(0.25))
|
||||
<< " 50% " << pretty(stat.percentile(0.50))
|
||||
<< " 75% " << pretty(stat.percentile(0.75))
|
||||
<< " (" << stat.count() << " calls)";
|
||||
dump_impl(c.second, depth + 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue