Add history vector size to readout
parent
596c75dc6f
commit
7a181e0c71
|
@ -54,7 +54,7 @@ namespace blt::profiling {
|
|||
}
|
||||
|
||||
void printProfile(const std::string& profileName, blt::logging::LOG_LEVEL loggingLevel, bool averageHistory, bool ignoreNegatives) {
|
||||
string::TableFormatter formatter {profileName};
|
||||
string::TableFormatter formatter{profileName};
|
||||
formatter.addColumn({"Interval"});
|
||||
formatter.addColumn({"Time (ns)"});
|
||||
formatter.addColumn({"Time (ms)"});
|
||||
|
@ -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)
|
||||
|
@ -133,7 +141,7 @@ namespace blt::profiling {
|
|||
|
||||
std::sort(unorderedIntervalVector.begin(), unorderedIntervalVector.end(), timeCompare);
|
||||
|
||||
string::TableFormatter formatter {profileName};
|
||||
string::TableFormatter formatter{profileName};
|
||||
formatter.addColumn({"Order"});
|
||||
formatter.addColumn({"Interval"});
|
||||
formatter.addColumn({"Time (ns)"});
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue