From 1c8e60f91a647e681fa700d8b8ec9b49a940061f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 28 Sep 2015 21:30:31 +0200 Subject: Added LuaState tracker and memory stats logging. --- src/Server.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index a21248695..12c45467d 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -145,6 +145,8 @@ cServer::cServer(void) : m_ShouldLoadOfflinePlayerData(false), m_ShouldLoadNamedPlayerData(true) { + // Initialize the LuaStateTracker singleton before the app goes multithreaded: + cLuaStateTracker::GetStats(); } @@ -522,6 +524,13 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac a_Output.Finished(); return; } + + else if (split[0].compare("luastats") == 0) + { + a_Output.Out(cLuaStateTracker::GetStats()); + a_Output.Finished(); + return; + } #if defined(_MSC_VER) && defined(_DEBUG) && defined(ENABLE_LEAK_FINDER) else if (split[0].compare("dumpmem") == 0) { -- cgit v1.2.3