From 05508b5c5610c5f56233d26aba46ee361fcab667 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 30 Sep 2014 18:12:51 +0100 Subject: Add "debug lludp throttle log " to control extra throttle related debug logging. --- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 49 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 0393a29..e45de51 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -434,7 +434,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion BinaryStats - m_throttle = new TokenBucket(null, sceneThrottleBps); + // FIXME: Can't add info here because don't know scene yet. +// m_throttle +// = new TokenBucket( +// string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps); + + m_throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps); + ThrottleRates = new ThrottleRates(configSource); if (usePools) @@ -758,6 +764,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP MainConsole.Instance.Commands.AddCommand( "Debug", false, + "debug lludp throttle log", + "debug lludp throttle log ", + "Change debug logging level for throttles.", + "If level >= 0 then throttle debug logging is performed.\n" + + "If level <= 0 then no throttle debug logging is performed.", + HandleThrottleCommand); + + MainConsole.Instance.Commands.AddCommand( + "Debug", + false, "debug lludp toggle agentupdate", "debug lludp toggle agentupdate", "Toggle whether agentupdate packets are processed or simply discarded.", @@ -795,6 +811,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP }); } + private void HandleThrottleCommand(string module, string[] args) + { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) + return; + + if (args.Length != 7) + { + MainConsole.Instance.OutputFormat("Usage: debug lludp throttle log "); + return; + } + + int level; + if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out level)) + return; + + string firstName = args[5]; + string lastName = args[6]; + + Scene.ForEachScenePresence(sp => + { + if (sp.Firstname == firstName && sp.Lastname == lastName) + { + MainConsole.Instance.OutputFormat( + "Throttle log level for {0} ({1}) set to {2} in {3}", + sp.Name, sp.IsChildAgent ? "child" : "root", level, Scene.Name); + + ((LLClientView)sp.ControllingClient).UDPClient.ThrottleDebugLevel = level; + } + }); + } + private void HandlePacketCommand(string module, string[] args) { if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) -- cgit v1.1