add min, max, stddev to stats

This commit is contained in:
Lion Kortlepel
2024-01-24 01:26:16 +01:00
committed by Lion
parent 88721d4f7f
commit 4347cb4af2
3 changed files with 52 additions and 17 deletions

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;
});