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)
|
for (auto const & c : node.children)
|
||||||
{
|
{
|
||||||
auto const & stat = c.second.execution_time;
|
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
|
if (stat.count() == 1)
|
||||||
<< " avg " << pretty(stat.mean())
|
log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first
|
||||||
<< " 25% " << pretty(stat.percentile(0.25))
|
<< " " << pretty(stat.mean())
|
||||||
<< " 50% " << pretty(stat.percentile(0.50))
|
<< " (" << stat.count() << " call)";
|
||||||
<< " 75% " << pretty(stat.percentile(0.75))
|
else
|
||||||
<< " (" << stat.count() << " calls)";
|
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);
|
dump_impl(c.second, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue