From 2bad430ed860987f82e9f074b2a467749d9fddc6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 28 Apr 2012 00:08:04 +0100 Subject: Put scene object related console commands into new "Objects" help category rather than "Regions" --- OpenSim/Region/Application/OpenSim.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 59b6b21..4ec64ee 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -225,7 +225,7 @@ namespace OpenSim /// private void RegisterConsoleCommands() { - m_console.Commands.AddCommand("Regions", false, "force update", + m_console.Commands.AddCommand("Objects", false, "force update", "force update", "Force the update of all objects on clients", HandleForceUpdate); @@ -306,7 +306,7 @@ namespace OpenSim + " If this is not given then the oar is saved to region.oar in the current directory.", SaveOar); - m_console.Commands.AddCommand("Regions", false, "edit scale", + m_console.Commands.AddCommand("Objects", false, "edit scale", "edit scale ", "Change the scale of a named prim", HandleEditScale); @@ -349,7 +349,7 @@ namespace OpenSim "show ratings", "Show rating data", HandleShow); - m_console.Commands.AddCommand("Regions", false, "backup", + m_console.Commands.AddCommand("Objects", false, "backup", "backup", "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); @@ -410,7 +410,7 @@ namespace OpenSim "modules unload ", "Unload a module", HandleModules); - m_console.Commands.AddCommand("Regions", false, "kill uuid", + m_console.Commands.AddCommand("Objects", false, "kill uuid", "kill uuid ", "Kill an object by UUID", KillUUID); } -- cgit v1.1 From 231a3bf147315a9284140476d2b09e13c3fee1c0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 May 2012 01:45:49 +0100 Subject: Implement optional name and description on http stream handlers so that we can relate a slow request to what the handler actually does and the agent it serves, if applicable. This is most useful for capabilities where the url is not self-describing. --- OpenSim/Region/Application/OpenSimBase.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 5de3f25..79259d8 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -388,7 +388,7 @@ namespace OpenSim scene.LoadPrimsFromStorage(regionInfo.originRegionID); // TODO : Try setting resource for region xstats here on scene - MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); + MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo)); scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); scene.EventManager.TriggerParcelPrimCountUpdate(); @@ -773,6 +773,9 @@ namespace OpenSim return Util.UTF8.GetBytes("OK"); } + public string Name { get { return "SimStatus"; } } + public string Description { get { return "Simulator Status"; } } + public string ContentType { get { return "text/plain"; } @@ -797,6 +800,9 @@ namespace OpenSim { OpenSimBase m_opensim; string osXStatsURI = String.Empty; + + public string Name { get { return "XSimStatus"; } } + public string Description { get { return "Simulator XStatus"; } } public XSimStatusHandler(OpenSimBase sim) { @@ -837,6 +843,9 @@ namespace OpenSim { OpenSimBase m_opensim; string osUXStatsURI = String.Empty; + + public string Name { get { return "UXSimStatus"; } } + public string Description { get { return "Simulator UXStatus"; } } public UXSimStatusHandler(OpenSimBase sim) { -- cgit v1.1 From de44734fe9a0b31cd8cb78c0f58e61a35fe2a259 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 10 May 2012 09:08:40 -0700 Subject: Saving estate state is really slow (relatively) and it gets completely rewritten every time a region starts up. This makes the data write only when the data was not already read from the database. There is a still a major race condition whenever two regions share the same estate data, but at least it won't be triggered on startup. --- OpenSim/Region/Application/OpenSim.cs | 5 +++-- OpenSim/Region/Application/OpenSimBase.cs | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 4ec64ee..6796f2b 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -618,10 +618,11 @@ namespace OpenSim return; } - PopulateRegionEstateInfo(regInfo); + bool changed = PopulateRegionEstateInfo(regInfo); IScene scene; CreateRegion(regInfo, true, out scene); - regInfo.EstateSettings.Save(); + if (changed) + regInfo.EstateSettings.Save(); } /// diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 79259d8..045e8d2 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -977,13 +977,13 @@ namespace OpenSim /// Load the estate information for the provided RegionInfo object. /// /// - public void PopulateRegionEstateInfo(RegionInfo regInfo) + public bool PopulateRegionEstateInfo(RegionInfo regInfo) { if (EstateDataService != null) regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); if (regInfo.EstateSettings.EstateID != 0) - return; + return false; // estate info in the database did not change m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); @@ -1018,7 +1018,7 @@ namespace OpenSim } if (defaultEstateJoined) - return; + return true; // need to update the database else m_log.ErrorFormat( "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName); @@ -1080,8 +1080,10 @@ namespace OpenSim MainConsole.Instance.Output("Joining the estate failed. Please try again."); } } - } - } + } + + return true; // need to update the database + } } public class OpenSimConfigSource -- cgit v1.1 From 0b02a4d42e989609a4e1ba39d2aee9a7f9655613 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 31 May 2012 01:52:26 +0100 Subject: Add an optional mechanism for physics modules to collect and return arbitrary stats. If active, the physics module can return arbitrary stat counters that can be seen via the MonitoringModule (http://opensimulator.org/wiki/Monitoring_Module) This is only active in OdeScene if collect_stats = true in [ODEPhysicsSettings]. This patch allows OdeScene to collect elapsed time information for calls to the ODE native collision methods to assess what proportion of time this takes compared to total physics processing. This data is returned as ODENativeCollisionFrameMS in the monitoring module, updated every 3 seconds. The performance effect of collecting stats is probably extremely minor, dwarfed by the rest of the physics code. --- OpenSim/Region/Application/OpenSim.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6796f2b..c0913c5 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Reflection; using System.Text; @@ -138,7 +139,7 @@ namespace OpenSim m_log.Info("===================================================================="); m_log.Info("========================= STARTING OPENSIM ========================="); m_log.Info("===================================================================="); - + //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); // http://msdn.microsoft.com/en-us/library/bb384202.aspx //GCSettings.LatencyMode = GCLatencyMode.Batch; -- cgit v1.1 From 3229e32b4e818c6a0897800d8770c95f90ee3a94 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Mon, 4 Jun 2012 17:22:46 -0400 Subject: Add replaceable region modules to the "show modules" command --- OpenSim/Region/Application/OpenSim.cs | 78 ++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index c0913c5..76ac827 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -971,8 +971,7 @@ namespace OpenSim if (showParams.Length > 1 && showParams[1] == "full") { agents = m_sceneManager.GetCurrentScenePresences(); - } - else + } else { agents = m_sceneManager.GetCurrentSceneAvatars(); } @@ -981,7 +980,8 @@ namespace OpenSim MainConsole.Instance.Output( String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname", - "Agent ID", "Root/Child", "Region", "Position")); + "Agent ID", "Root/Child", "Region", "Position") + ); foreach (ScenePresence presence in agents) { @@ -991,8 +991,7 @@ namespace OpenSim if (regionInfo == null) { regionName = "Unresolvable"; - } - else + } else { regionName = regionInfo.RegionName; } @@ -1005,7 +1004,8 @@ namespace OpenSim presence.UUID, presence.IsChildAgent ? "Child" : "Root", regionName, - presence.AbsolutePosition.ToString())); + presence.AbsolutePosition.ToString()) + ); } MainConsole.Instance.Output(String.Empty); @@ -1014,16 +1014,20 @@ namespace OpenSim case "connections": System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); m_sceneManager.ForEachScene( - delegate(Scene scene) - { - scene.ForEachClient( - delegate(IClientAPI client) - { - connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n", - scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode); - } + delegate(Scene scene) { + scene.ForEachClient( + delegate(IClientAPI client) { + connections.AppendFormat( + "{0}: {1} ({2}) from {3} on circuit {4}\n", + scene.RegionInfo.RegionName, + client.Name, + client.AgentId, + client.RemoteEndPoint, + client.CircuitCode ); } + ); + } ); MainConsole.Instance.Output(connections.ToString()); @@ -1032,13 +1036,17 @@ namespace OpenSim case "circuits": System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); m_sceneManager.ForEachScene( - delegate(Scene scene) - { - //this.HttpServer. - acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); - foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) - acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root")); - } + delegate(Scene scene) { + //this.HttpServer. + acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); + foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) + acd.AppendFormat( + "\t{0} {1} ({2})\n", + aCircuit.firstname, + aCircuit.lastname, + (aCircuit.child ? "Child" : "Root") + ); + } ); MainConsole.Instance.Output(acd.ToString()); @@ -1079,17 +1087,29 @@ namespace OpenSim } m_sceneManager.ForEachScene( - delegate(Scene scene) + delegate(Scene scene) { + m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:"); + foreach (IRegionModule module in scene.Modules.Values) { - m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:"); - foreach (IRegionModule module in scene.Modules.Values) + if (!module.IsSharedModule) { - if (!module.IsSharedModule) - { - m_log.Error("Region Module: " + module.Name); - } + m_log.Error("Region Module: " + module.Name); } - }); + } + } + ); + + m_sceneManager.ForEachScene( + delegate(Scene scene) { + MainConsole.Instance.Output("Loaded new region modules in" + scene.RegionInfo.RegionName + " are:"); + foreach (IRegionModuleBase module in scene.RegionModules.Values) + { + Type type = module.GetType().GetInterface("ISharedRegionModule"); + string module_type = type != null ? "Shared" : "Non-Shared"; + MainConsole.Instance.OutputFormat("New Region Module ({0}): {1}", module_type, module.Name); + } + } + ); MainConsole.Instance.Output(""); break; -- cgit v1.1 From 98b46d48fefc7801b7c9e496000e9329f4266e5e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 7 Jun 2012 02:44:13 +0100 Subject: Allow the thread watchdog to accept an alarm method that is invoked if the timeout is breached. This alarm can then invoke this to log extra information. This is used in LLUDPServer to show which client was being processed when incoming and outgoing udp watchdog alarms are triggered. --- OpenSim/Region/Application/OpenSim.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 76ac827..caba236 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -438,12 +438,16 @@ namespace OpenSim } } - private void WatchdogTimeoutHandler(System.Threading.Thread thread, int lastTick) + private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) { int now = Environment.TickCount & Int32.MaxValue; - m_log.ErrorFormat("[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago", - thread.Name, thread.ThreadState, now - lastTick); + m_log.ErrorFormat( + "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", + twi.Thread.Name, + twi.Thread.ThreadState, + now - twi.LastTick, + twi.AlarmMethod != null ? string.Format("Data: {0}", twi.AlarmMethod()) : ""); } #region Console Commands -- cgit v1.1 From b56673c920603022fce9cb479b714f6fbd0f1311 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Jun 2012 00:18:25 +0100 Subject: Fix bug with "kick user" reducing agent counts by 2 instead of 1. This is done by making the kick user command call IClientAPI.Close() rather than routing through Scene.IncomingCloseAgent(), which also called IClientAPI.Close() DisableSimulator for child agents is moved from IncomingCloseAgent() to RemoveClient(), this is not a functional change since IncomingCloseAgent() always ends up calling RemoveClient() --- OpenSim/Region/Application/OpenSim.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index caba236..1d00522 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -486,10 +486,10 @@ namespace OpenSim else presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); - // ...and close on our side - presence.Scene.IncomingCloseAgent(presence.UUID); + presence.ControllingClient.Close(); } } + MainConsole.Instance.Output(""); } -- cgit v1.1 From 5c162ccd57639f0c711d9940ecdd3e2804d26304 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Jun 2012 00:59:39 +0100 Subject: Go back to calling IncomingCloseAgent() in the "kick user" command for consistency instead of IClientAPI.Close() directly. This no longer double counts child agent removals --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 1d00522..9c38ebe 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -486,7 +486,7 @@ namespace OpenSim else presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); - presence.ControllingClient.Close(); + presence.Scene.IncomingCloseAgent(presence.UUID); } } -- cgit v1.1 From 5f4f9f02309b7df4d1bdcc560cee96d266c48a07 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Jun 2012 03:12:23 +0100 Subject: Add regression test for client logout due to ack timeout. --- OpenSim/Region/Application/OpenSimBase.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 045e8d2..9a0fa70 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -223,8 +223,6 @@ namespace OpenSim base.StartupSpecific(); - m_stats = StatsManager.StartCollectingSimExtraStats(); - // Create a ModuleLoader instance m_moduleLoader = new ModuleLoader(m_config.Source); -- cgit v1.1 From 817f2d341d30c7df1556071c9cc8b4c4a5588cb5 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 8 Jun 2012 23:36:53 +0100 Subject: Fix regression in 5f4f9f0 (Fri Jun 8 2012) which stopped "show stats" and json stats from working --- OpenSim/Region/Application/OpenSimBase.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 9a0fa70..3271555 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -223,6 +223,8 @@ namespace OpenSim base.StartupSpecific(); + m_stats = StatsManager.SimExtraStats; + // Create a ModuleLoader instance m_moduleLoader = new ModuleLoader(m_config.Source); -- cgit v1.1 From c53c55fed02d02af419fb2968764fcefa5faac37 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Tue, 12 Jun 2012 17:07:10 -0400 Subject: Add variable timer configureation for the timer_Script Added "timer_Interval" to the OpenSimDefaults.ini, leaving the default value set to 1200, as the previous default setting. The value represents seconds. To change the default, copy the entry to OpenSim.ini and multiply the number of minutes for the interval by 60. --- OpenSim/Region/Application/OpenSim.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9c38ebe..57a3c69 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -70,6 +70,7 @@ namespace OpenSim private Regex m_consolePromptRegex = new Regex(@"([^\\])\\(\w)", RegexOptions.Compiled); private string m_timedScript = "disabled"; + private int m_timeInterval = 1200; private Timer m_scriptTimer; public OpenSim(IConfigSource configSource) : base(configSource) @@ -99,6 +100,10 @@ namespace OpenSim m_consolePort = (uint)networkConfig.GetInt("console_port", 0); m_timedScript = startupConfig.GetString("timer_Script", "disabled"); + if (m_timedScript != "disabled") + { + m_timeInterval = startupConfig.GetInt("timer_Interval", 1200); + } if (m_logFileAppender != null) { @@ -216,7 +221,7 @@ namespace OpenSim { m_scriptTimer = new Timer(); m_scriptTimer.Enabled = true; - m_scriptTimer.Interval = 1200*1000; + m_scriptTimer.Interval = m_timeInterval*1000; m_scriptTimer.Elapsed += RunAutoTimerScript; } } -- cgit v1.1 From 9825861f4ac8d78665c33e2630824d97b356e642 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Jun 2012 23:46:09 +0100 Subject: Shuffle "debug http" levels so that 1 and 2 now cause different levels of warn to be logged if we receive invalid xml for xmlrpc. --- OpenSim/Region/Application/OpenSim.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 57a3c69..96d41a4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -250,10 +250,11 @@ namespace OpenSim m_console.Commands.AddCommand("Comms", false, "debug http", "debug http ", - "Turn on inbound http request debugging for everything except the event queue (see debug eq).", - "If level >= 2 then the handler used to service the request is logged.\n" - + "If level >= 1 then incoming HTTP requests are logged.\n" - + "If level <= 0 then no extra http logging is done.\n", + "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", + "If level <= 0, then no extra logging is done.\n" + + "If level >= 1, then short warnings are logged when receiving bad input data.\n" + + "If level >= 2, then long warnings are logged when receiving bad input data.\n" + + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n", Debug); m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); -- cgit v1.1 From 93ba0332c4ccbb0c60e6d60fff71dc7d1567c9dd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Jun 2012 23:54:12 +0100 Subject: minor: Extend 'debug http' usage statement to 0..3 from 0..2 --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 96d41a4..00ae880 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -927,7 +927,7 @@ namespace OpenSim } } - MainConsole.Instance.Output("Usage: debug http 0..2"); + MainConsole.Instance.Output("Usage: debug http 0..3"); break; case "scene": -- cgit v1.1 From 478acfff34b94c7c42bdb927be531b669c43af72 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 01:24:36 +0100 Subject: When setting debug http level, do this for all known http servers, not just the main instance. --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 00ae880..9043137 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -921,7 +921,7 @@ namespace OpenSim int newDebug; if (int.TryParse(args[2], out newDebug)) { - MainServer.Instance.DebugLevel = newDebug; + MainServer.DebugLevel = newDebug; MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); break; } -- cgit v1.1 From aeed4d3041af75cf18d140208cc4c744a73d0492 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 01:27:29 +0100 Subject: minor: Tell user the current debug http level if "debug http" console command is executed without a level parameter --- OpenSim/Region/Application/OpenSim.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9043137..abb30a9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -249,12 +249,13 @@ namespace OpenSim Debug); m_console.Commands.AddCommand("Comms", false, "debug http", - "debug http ", + "debug http []", "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", "If level <= 0, then no extra logging is done.\n" + "If level >= 1, then short warnings are logged when receiving bad input data.\n" + "If level >= 2, then long warnings are logged when receiving bad input data.\n" - + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n", + + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" + + "If no level is specified then the current level is returned.", Debug); m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); @@ -926,8 +927,15 @@ namespace OpenSim break; } } + else if (args.Length == 2) + { + MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel); + } + else + { + MainConsole.Instance.Output("Usage: debug http 0..3"); + } - MainConsole.Instance.Output("Usage: debug http 0..3"); break; case "scene": -- cgit v1.1 From 94517c8d5c63f9e8a1ea9a83b04db956f27aa25d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 02:51:52 +0100 Subject: Make the "debug http" command available for robust as well as the simulator. This allows one to see incoming requests as they happen. This required making everything use the common MainServer class for registering and retrieving http servers, rather than duplicate structures. --- OpenSim/Region/Application/OpenSim.cs | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index abb30a9..faa9e09 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -231,6 +231,8 @@ namespace OpenSim /// private void RegisterConsoleCommands() { + MainServer.RegisterHttpConsoleCommands(m_console); + m_console.Commands.AddCommand("Objects", false, "force update", "force update", "Force the update of all objects on clients", @@ -248,16 +250,6 @@ namespace OpenSim + "If an avatar name is given then only packets from that avatar are logged", Debug); - m_console.Commands.AddCommand("Comms", false, "debug http", - "debug http []", - "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", - "If level <= 0, then no extra logging is done.\n" - + "If level >= 1, then short warnings are logged when receiving bad input data.\n" - + "If level >= 2, then long warnings are logged when receiving bad input data.\n" - + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" - + "If no level is specified then the current level is returned.", - Debug); - m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); m_console.Commands.AddCommand("Regions", false, "debug scene", @@ -916,28 +908,6 @@ namespace OpenSim break; - case "http": - if (args.Length == 3) - { - int newDebug; - if (int.TryParse(args[2], out newDebug)) - { - MainServer.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); - break; - } - } - else if (args.Length == 2) - { - MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel); - } - else - { - MainConsole.Instance.Output("Usage: debug http 0..3"); - } - - break; - case "scene": if (args.Length == 4) { -- cgit v1.1 From c935f0346750d510e5c3c3c2ff62c84609a115e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 03:32:43 +0100 Subject: Put all debug console commands into a single Debug section rather than scattering them over other categories --- OpenSim/Region/Application/OpenSim.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index faa9e09..04ff4e6 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -238,7 +238,7 @@ namespace OpenSim "Force the update of all objects on clients", HandleForceUpdate); - m_console.Commands.AddCommand("Comms", false, "debug packet", + m_console.Commands.AddCommand("Debug", false, "debug packet", "debug packet [ ]", "Turn on packet debugging", "If level > 255 then all incoming and outgoing packets are logged.\n" @@ -250,9 +250,9 @@ namespace OpenSim + "If an avatar name is given then only packets from that avatar are logged", Debug); - m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); + m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); - m_console.Commands.AddCommand("Regions", false, "debug scene", + m_console.Commands.AddCommand("Debug", false, "debug scene", "debug scene ", "Turn on scene debugging", Debug); -- cgit v1.1 From 87ca820f9bc19fc1f8c7b88a87bdef59e0a5bd0b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 26 Jun 2012 23:28:48 +0100 Subject: Replace "kill uuid" console command with the more consistent "delete object uuid", which was present in the last opensim release. --- OpenSim/Region/Application/OpenSim.cs | 56 ----------------------------------- 1 file changed, 56 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 04ff4e6..56ad5c9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -409,10 +409,6 @@ namespace OpenSim m_console.Commands.AddCommand("General", false, "modules unload", "modules unload ", "Unload a module", HandleModules); - - m_console.Commands.AddCommand("Objects", false, "kill uuid", - "kill uuid ", - "Kill an object by UUID", KillUUID); } public override void ShutdownSpecific() @@ -1309,58 +1305,6 @@ namespace OpenSim return result; } - /// - /// Kill an object given its UUID. - /// - /// - protected void KillUUID(string module, string[] cmdparams) - { - if (cmdparams.Length > 2) - { - UUID id = UUID.Zero; - SceneObjectGroup grp = null; - Scene sc = null; - - if (!UUID.TryParse(cmdparams[2], out id)) - { - MainConsole.Instance.Output("[KillUUID]: Error bad UUID format!"); - return; - } - - m_sceneManager.ForEachScene( - delegate(Scene scene) - { - SceneObjectPart part = scene.GetSceneObjectPart(id); - if (part == null) - return; - - grp = part.ParentGroup; - sc = scene; - }); - - if (grp == null) - { - MainConsole.Instance.Output(String.Format("[KillUUID]: Given UUID {0} not found!", id)); - } - else - { - MainConsole.Instance.Output(String.Format("[KillUUID]: Found UUID {0} in scene {1}", id, sc.RegionInfo.RegionName)); - try - { - sc.DeleteSceneObject(grp, false); - } - catch (Exception e) - { - m_log.ErrorFormat("[KillUUID]: Error while removing objects from scene: " + e); - } - } - } - else - { - MainConsole.Instance.Output("[KillUUID]: Usage: kill uuid "); - } - } - #endregion } } -- cgit v1.1 From 843112340e3220e6bef5a05d8607efb478e19013 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 6 Jul 2012 00:37:45 +0100 Subject: Log MONO_THREADS_PER_CPU value on simulator startup, or "unset" if it is not set --- OpenSim/Region/Application/Application.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index c130038..ebfebc4 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -92,9 +92,14 @@ namespace OpenSim m_log.Info("[OPENSIM MAIN]: configured log4net using default OpenSim.exe.config"); } - m_log.DebugFormat( + m_log.InfoFormat( "[OPENSIM MAIN]: System Locale is {0}", System.Threading.Thread.CurrentThread.CurrentCulture); + string monoThreadsPerCpu = System.Environment.GetEnvironmentVariable("MONO_THREADS_PER_CPU"); + + m_log.InfoFormat( + "[OPENSIM MAIN]: Environment variable MONO_THREADS_PER_CPU is {0}", monoThreadsPerCpu ?? "unset"); + // Increase the number of IOCP threads available. Mono defaults to a tragically low number int workerThreads, iocpThreads; System.Threading.ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); @@ -109,7 +114,6 @@ namespace OpenSim // Check if the system is compatible with OpenSimulator. // Ensures that the minimum system requirements are met - m_log.Info("Performing compatibility checks... \n"); string supported = String.Empty; if (Util.IsEnvironmentSupported(ref supported)) { -- cgit v1.1 From ca412032e89939146a05cf708a4b9df93f74c4ac Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Jul 2012 21:36:33 +0100 Subject: Put output for "show connections" command into standard table format. Also moves into own method. --- OpenSim/Region/Application/OpenSim.cs | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 56ad5c9..f3e4a2d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -996,25 +996,7 @@ namespace OpenSim break; case "connections": - System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); - m_sceneManager.ForEachScene( - delegate(Scene scene) { - scene.ForEachClient( - delegate(IClientAPI client) { - connections.AppendFormat( - "{0}: {1} ({2}) from {3} on circuit {4}\n", - scene.RegionInfo.RegionName, - client.Name, - client.AgentId, - client.RemoteEndPoint, - client.CircuitCode - ); - } - ); - } - ); - - MainConsole.Instance.Output(connections.ToString()); + HandleShowConnections(); break; case "circuits": @@ -1138,6 +1120,21 @@ namespace OpenSim } } + private void HandleShowConnections() + { + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Region", 20); + cdt.AddColumn("Avatar name", 25); + cdt.AddColumn("Remote endpoint", 23); + cdt.AddColumn("Circuit number", 14); + + m_sceneManager.ForEachScene( + s => s.ForEachClient( + c => cdt.AddRow(s.RegionInfo.RegionName, c.Name, c.RemoteEndPoint.ToString(), c.CircuitCode.ToString()))); + + MainConsole.Instance.Output(cdt.ToString()); + } + /// /// Use XML2 format to serialize data to a file /// -- cgit v1.1 From 6a0de355e09c264ce3f9e2c7db0b69919794e30c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Jul 2012 22:37:48 +0100 Subject: Add active status to "show connections" --- OpenSim/Region/Application/OpenSim.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index f3e4a2d..e980716 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -1127,10 +1127,16 @@ namespace OpenSim cdt.AddColumn("Avatar name", 25); cdt.AddColumn("Remote endpoint", 23); cdt.AddColumn("Circuit number", 14); + cdt.AddColumn("Active?", 7); m_sceneManager.ForEachScene( s => s.ForEachClient( - c => cdt.AddRow(s.RegionInfo.RegionName, c.Name, c.RemoteEndPoint.ToString(), c.CircuitCode.ToString()))); + c => cdt.AddRow( + s.RegionInfo.RegionName, + c.Name, + c.RemoteEndPoint.ToString(), + c.CircuitCode.ToString(), + c.IsActive.ToString()))); MainConsole.Instance.Output(cdt.ToString()); } -- cgit v1.1 From 15283d35f1c567d6b33d0ba2884c1a73c83c6ce6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Jul 2012 23:09:36 +0100 Subject: Extend "show circuits" to show circuit code, ip and viewer name. Also change to use standard table formatting "show circuits" and "show connections" console commands are very similar but access different data structures. --- OpenSim/Region/Application/OpenSim.cs | 51 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e980716..230af8e 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -1000,22 +1000,7 @@ namespace OpenSim break; case "circuits": - System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); - m_sceneManager.ForEachScene( - delegate(Scene scene) { - //this.HttpServer. - acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); - foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) - acd.AppendFormat( - "\t{0} {1} ({2})\n", - aCircuit.firstname, - aCircuit.lastname, - (aCircuit.child ? "Child" : "Root") - ); - } - ); - - MainConsole.Instance.Output(acd.ToString()); + HandleShowCircuits(); break; case "http-handlers": @@ -1120,19 +1105,45 @@ namespace OpenSim } } + private void HandleShowCircuits() + { + ConsoleDisplayTable cdt = new ConsoleDisplayTable(); + cdt.AddColumn("Region", 20); + cdt.AddColumn("Avatar name", 24); + cdt.AddColumn("Type", 5); + cdt.AddColumn("Code", 10); + cdt.AddColumn("IP", 16); + cdt.AddColumn("Viewer Name", 24); + + m_sceneManager.ForEachScene( + s => + { + foreach (AgentCircuitData aCircuit in s.AuthenticateHandler.GetAgentCircuits().Values) + cdt.AddRow( + s.Name, + aCircuit.Name, + aCircuit.child ? "child" : "root", + aCircuit.circuitcode.ToString(), + aCircuit.IPAddress.ToString(), + aCircuit.Viewer); + }); + + MainConsole.Instance.Output(cdt.ToString()); + } + private void HandleShowConnections() { ConsoleDisplayTable cdt = new ConsoleDisplayTable(); cdt.AddColumn("Region", 20); - cdt.AddColumn("Avatar name", 25); - cdt.AddColumn("Remote endpoint", 23); - cdt.AddColumn("Circuit number", 14); + cdt.AddColumn("Avatar name", 24); + cdt.AddColumn("Circuit code", 12); + cdt.AddColumn("Endpoint", 23); cdt.AddColumn("Active?", 7); m_sceneManager.ForEachScene( s => s.ForEachClient( c => cdt.AddRow( - s.RegionInfo.RegionName, + s.Name, c.Name, c.RemoteEndPoint.ToString(), c.CircuitCode.ToString(), -- cgit v1.1