add min, max, stddev to stats

This commit is contained in:
Lion Kortlepel authored and Lion committed 2024-03-06 10:27:22 +01:00
1 parent 88721d4f7f
commit 4347cb4af2
3 files changed
+52 -17

No files matched your search

+7 -3
View File
@@ -852,9 +852,13 @@ TLuaEngine::StateThreadData::StateThreadData(const std::string& Name, TLuaStateI
UtilTable.set_function("DebugExecutionTime", [this]() -> sol::table {
sol::state_view StateView(mState);
sol::table Result = StateView.create_table();
auto durs = mProfile.all_average_durations();
for (const auto& [name, dur] : durs) {
Result[name] = dur;
auto stats = mProfile.all_stats();
for (const auto& [name, stat] : stats) {
Result[name] = StateView.create_table();
Result[name]["mean"] = stat.mean;
Result[name]["stddev"] = stat.stddev;
Result[name]["min"] = stat.min;
Result[name]["max"] = stat.max;
}
return Result;
});