diff options
author | Justin Clark-Casey (justincc) | 2014-09-30 18:12:51 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-10-02 22:30:44 +0100 |
commit | 05508b5c5610c5f56233d26aba46ee361fcab667 (patch) | |
tree | 852dda9602b6902c18ae1974320df87867cb7b50 /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | Don't unnecessarily remove from backup objects that were not directly attache... (diff) | |
download | opensim-SC-05508b5c5610c5f56233d26aba46ee361fcab667.zip opensim-SC-05508b5c5610c5f56233d26aba46ee361fcab667.tar.gz opensim-SC-05508b5c5610c5f56233d26aba46ee361fcab667.tar.bz2 opensim-SC-05508b5c5610c5f56233d26aba46ee361fcab667.tar.xz |
Add "debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>" to control extra throttle related debug logging.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 49 |
1 files changed, 48 insertions, 1 deletions
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 | |||
434 | } | 434 | } |
435 | #endregion BinaryStats | 435 | #endregion BinaryStats |
436 | 436 | ||
437 | m_throttle = new TokenBucket(null, sceneThrottleBps); | 437 | // FIXME: Can't add info here because don't know scene yet. |
438 | // m_throttle | ||
439 | // = new TokenBucket( | ||
440 | // string.Format("server throttle bucket for {0}", Scene.Name), null, sceneThrottleBps); | ||
441 | |||
442 | m_throttle = new TokenBucket("server throttle bucket", null, sceneThrottleBps); | ||
443 | |||
438 | ThrottleRates = new ThrottleRates(configSource); | 444 | ThrottleRates = new ThrottleRates(configSource); |
439 | 445 | ||
440 | if (usePools) | 446 | if (usePools) |
@@ -758,6 +764,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
758 | MainConsole.Instance.Commands.AddCommand( | 764 | MainConsole.Instance.Commands.AddCommand( |
759 | "Debug", | 765 | "Debug", |
760 | false, | 766 | false, |
767 | "debug lludp throttle log", | ||
768 | "debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>", | ||
769 | "Change debug logging level for throttles.", | ||
770 | "If level >= 0 then throttle debug logging is performed.\n" | ||
771 | + "If level <= 0 then no throttle debug logging is performed.", | ||
772 | HandleThrottleCommand); | ||
773 | |||
774 | MainConsole.Instance.Commands.AddCommand( | ||
775 | "Debug", | ||
776 | false, | ||
761 | "debug lludp toggle agentupdate", | 777 | "debug lludp toggle agentupdate", |
762 | "debug lludp toggle agentupdate", | 778 | "debug lludp toggle agentupdate", |
763 | "Toggle whether agentupdate packets are processed or simply discarded.", | 779 | "Toggle whether agentupdate packets are processed or simply discarded.", |
@@ -795,6 +811,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
795 | }); | 811 | }); |
796 | } | 812 | } |
797 | 813 | ||
814 | private void HandleThrottleCommand(string module, string[] args) | ||
815 | { | ||
816 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | ||
817 | return; | ||
818 | |||
819 | if (args.Length != 7) | ||
820 | { | ||
821 | MainConsole.Instance.OutputFormat("Usage: debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>"); | ||
822 | return; | ||
823 | } | ||
824 | |||
825 | int level; | ||
826 | if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out level)) | ||
827 | return; | ||
828 | |||
829 | string firstName = args[5]; | ||
830 | string lastName = args[6]; | ||
831 | |||
832 | Scene.ForEachScenePresence(sp => | ||
833 | { | ||
834 | if (sp.Firstname == firstName && sp.Lastname == lastName) | ||
835 | { | ||
836 | MainConsole.Instance.OutputFormat( | ||
837 | "Throttle log level for {0} ({1}) set to {2} in {3}", | ||
838 | sp.Name, sp.IsChildAgent ? "child" : "root", level, Scene.Name); | ||
839 | |||
840 | ((LLClientView)sp.ControllingClient).UDPClient.ThrottleDebugLevel = level; | ||
841 | } | ||
842 | }); | ||
843 | } | ||
844 | |||
798 | private void HandlePacketCommand(string module, string[] args) | 845 | private void HandlePacketCommand(string module, string[] args) |
799 | { | 846 | { |
800 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) | 847 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != Scene) |