Show fraction of calls compared to parent in profiler dump

This commit is contained in:
Nikita Lisitsa 2022-08-05 13:36:28 +03:00
parent c28b93aadc
commit dc1b86fa75

View file

@ -96,6 +96,13 @@ namespace psemek::prof
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 if (node.execution_time.count() > 0)
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, " << std::setprecision(3) << (stat.count() * 1.f / node.execution_time.count() * 1.f) << "x)";
else
log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first
<< " avg " << pretty(stat.mean())