Add "debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>" to control extra throttle related debug logging.

This commit is contained in:
Justin Clark-Casey (justincc)
2014-09-30 18:12:51 +01:00
parent 2a9528fa22
commit 05508b5c56
3 changed files with 111 additions and 18 deletions

View File

@@ -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)
@@ -755,6 +761,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"Return status of LLUDP packet processing.",
HandleStatusCommand);
MainConsole.Instance.Commands.AddCommand(
"Debug",
false,
"debug lludp throttle log",
"debug lludp throttle log <level> <avatar-first-name> <avatar-last-name>",
"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,
@@ -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 <level> <avatar-first-name> <avatar-last-name>");
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)