From a4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 31 Jan 2008 00:42:31 +0000 Subject: * Add asset/texture cache statistics to region server console * You can type 'stats' at the REGION# prompt to get this information in grid or standalone mode * Don't take these numbers as gospel yet, since for some reason textures displayed from inventory which require downloading from the server are being recorded as assets rather than textures * But I don't have any reason to believe they aren't broadly accurate. * I've put these in so I can tell whether the high memory usage on regions is down to the asset/texture cache * This will require a prebuild * DEV: Only adds needed to be implemented since, as far as I can tell, assets cached are currently never released. For my part, seeing large cache memory numbers will provoke me to think about doing something about this. * DEV: Now switched to using a singleton to get the stats reporters rather than threading the object through various layers * DEV: Will refactor the other server stats reporters to do this in one of the next commits --- OpenSim/Region/Application/OpenSimMain.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index f0e60cf..70f9fd0 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -39,6 +39,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; +using OpenSim.Framework.Statistics; using OpenSim.Region.ClientStack; using OpenSim.Region.Communications.Local; using OpenSim.Region.Communications.OGS1; @@ -244,7 +245,7 @@ namespace OpenSim if (m_storageDll == "OpenSim.DataStore.MonoSqlite.dll") { m_storageDll = "OpenSim.Framework.Data.SQLite.dll"; - Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is depreciated. Set storage_plugin to OpenSim.Framework.Data.SQLite.dll."); + Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Framework.Data.SQLite.dll."); Thread.Sleep(3000); } m_storageConnectionString @@ -301,8 +302,10 @@ namespace OpenSim // Create a log instance m_log = CreateLog(); - MainLog.Instance = m_log; + MainLog.Instance = m_log; + StatsManager.StartCollecting(); + // Do baseclass startup sequence: OpenSim.Region.ClientStack.RegionApplicationBase.StartUp // TerrainManager, StorageManager, HTTP Server // This base will call abstract Initialize @@ -703,6 +706,7 @@ namespace OpenSim m_log.Error("show uptime - show simulator startup and uptime."); m_log.Error("show users - show info about connected users."); m_log.Error("show modules - shows info aboutloaded modules."); + m_log.Error("stats - statistical information for this server not displayed in the client"); m_log.Error("shutdown - disconnect all clients and shutdown."); m_log.Error("terrain help - show help for terrain commands."); break; @@ -883,6 +887,19 @@ namespace OpenSim m_sceneManager.CurrentOrFirstScene.ExportWorldMap("exportmap.jpg"); } break; + + case "stats": + if (StatsManager.SimExtraStats != null) + { + MainLog.Instance.Notice( + "STATS", Environment.NewLine + StatsManager.SimExtraStats.Report()); + } + else + { + MainLog.Instance.Notice("STATS", "Extra statistics collection has not been enabled"); + } + break; + default: m_log.Error("Unknown command"); -- cgit v1.1