From 43520b3e8b85ceccbcf44a19b2526e0a517c4a74 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 30 Sep 2014 18:18:34 +0100 Subject: [PATCH] Add "debug lludp throttle status" command to return status information about a client's throttle (currently just whether adaptive is enabled). --- .../ClientStack/Linden/UDP/LLUDPServer.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index e45de51aa6..9757d35edc 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -771,6 +771,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP + "If level <= 0 then no throttle debug logging is performed.", HandleThrottleCommand); + MainConsole.Instance.Commands.AddCommand( + "Debug", + false, + "debug lludp throttle status", + "debug lludp throttle status ", + "Return status information about throttles.", + HandleThrottleStatusCommand); + MainConsole.Instance.Commands.AddCommand( "Debug", false, @@ -842,6 +850,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP }); } + private void HandleThrottleStatusCommand(string module, string[] args) + { + if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) + return; + + if (args.Length != 6) + { + MainConsole.Instance.OutputFormat("Usage: debug lludp throttle status "); + return; + } + + string firstName = args[4]; + string lastName = args[5]; + + Scene.ForEachScenePresence(sp => + { + if (sp.Firstname == firstName && sp.Lastname == lastName) + { + MainConsole.Instance.OutputFormat( + "Status for {0} ({1}) in {2}", + sp.Name, sp.IsChildAgent ? "child" : "root", Scene.Name); + + LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient; + MainConsole.Instance.OutputFormat("Adaptive throttle: {0}", udpClient.FlowThrottle.Enabled); + } + }); + } + private void HandlePacketCommand(string module, string[] args) { if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene)