Add "debug lludp throttle status" command to return status information about a client's throttle (currently just whether adaptive is enabled).

ghosts
Justin Clark-Casey (justincc) 2014-09-30 18:18:34 +01:00
parent ad15e06611
commit 8e5a62c8e7
1 changed files with 36 additions and 0 deletions

View File

@ -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 <avatar-first-name> <avatar-last-name>",
"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 <avatar-first-name> <avatar-last-name>");
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)