Performance Monitor Improvements:

1. Added command for runtime toggle
2. Changed where tick time is captured to properly capture per-tick statistics (matching cmangos playerbots)
This commit is contained in:
Christoph Wilk
2024-08-13 17:38:57 +09:00
parent e522db810c
commit 4d5dd0e2fc
6 changed files with 28 additions and 13 deletions

View File

@@ -83,6 +83,16 @@ public:
return true;
}
if (!strcmp(args, "toggle"))
{
sPlayerbotAIConfig->perfMonEnabled = !sPlayerbotAIConfig->perfMonEnabled;
if (sPlayerbotAIConfig->perfMonEnabled)
LOG_INFO("playerbots", "Performance monitor enabled");
else
LOG_INFO("playerbots", "Performance monitor disabled");
return true;
}
sPerformanceMonitor->PrintStats();
return true;
}