Add history vector size to readout

v1
Brett 2023-02-15 09:50:20 -05:00
parent 596c75dc6f
commit 7a181e0c71
1 changed files with 23 additions and 13 deletions

View File

@ -74,7 +74,11 @@ namespace blt::profiling {
total_difference += difference;
}
total_difference /= (long) history.size();
formatter.addRow({interval.first, std::to_string(total_difference), std::to_string((double) total_difference / 1000000.0)});
std::string name = "(";
name += std::to_string(history.size());
name += ") ";
name += interval.first;
formatter.addRow({name, std::to_string(total_difference), std::to_string((double) total_difference / 1000000.0)});
} else {
const auto difference = interval.second.end - interval.second.start;
if (ignoreNegatives && difference < 0)
@ -122,7 +126,11 @@ namespace blt::profiling {
total_difference += difference;
}
total_difference /= (long) history.size();
unorderedIntervalVector.emplace_back(total_difference, std::string("(H) ") += interval.first);
std::string name = "(";
name += std::to_string(history.size());
name += ") ";
name += interval.first;
unorderedIntervalVector.emplace_back(total_difference, name);
} else {
const auto difference = interval.second.end - interval.second.start;
if (ignoreNegatives && difference < 0)
@ -141,7 +149,9 @@ namespace blt::profiling {
int index = 1;
for (const auto& interval : unorderedIntervalVector) {
formatter.addRow({std::to_string(index++), interval.name, std::to_string(interval.difference), std::to_string(interval.difference / 1000000.0)});
formatter.addRow(
{std::to_string(index++), interval.name, std::to_string(interval.difference), std::to_string(interval.difference / 1000000.0)}
);
}
std::vector<std::string> updatedLines;