Add "debug lludp get/set new-client-throttle-max" to allow default new client throttle to be set separately from existing clients.

"debug lludp throttles get/set throttle-max" now only gets and sets current max client throttles
mb-throttle-test
Justin Clark-Casey (justincc) 2014-10-21 02:10:55 +01:00
parent 68d0c4d37b
commit 44dc58cc7f
1 changed files with 25 additions and 8 deletions

View File

@ -142,6 +142,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp throttles get",
"debug lludp throttles get [<avatar-first-name> <avatar-last-name>]",
"Return debug settings for throttles.",
"adaptive - true/false, controls adaptive throttle setting.\n"
+ "throttle-max - the max kbps throttle allowed for the specified existing clients. Use 'debug lludp get new-client-throttle-max' to see the setting for new clients.\n",
HandleThrottleGetCommand);
m_console.Commands.AddCommand(
@ -150,9 +152,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp throttles set",
"debug lludp throttles set <param> <value> [<avatar-first-name> <avatar-last-name>]",
"Set a throttle parameter for the given client.",
"Avaiable parameters are:\n"
+ "adaptive - true/false, control adaptive throttle setting\n"
+ "throttle-max - kbps, control maximum throttle setting for current and future clients\n",
"adaptive - true/false, controls adaptive throttle setting.\n"
+ "throttle-max - the max kbps throttle allowed for the specified existing clients. Use 'debug lludp set new-client-throttle-max' to change the settings for new clients.\n",
HandleThrottleSetCommand);
m_console.Commands.AddCommand(
@ -161,7 +162,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp get",
"debug lludp get",
"Get debug parameters for the server.",
"scene-throttle-max is the current max cumulative kbps provided for this scene to clients",
"scene-throttle-max - the current max cumulative kbps provided for this scene to clients.\n"
+ "new-client-throttle-max - the max kbps throttle allowed to new clients. Use 'debug lludp throttles set' to see the settings for existing clients.",
HandleGetCommand);
m_console.Commands.AddCommand(
@ -170,7 +172,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"debug lludp set",
"debug lludp set <param> <value>",
"Set a parameter for the server.",
"Only current setting is 'scene-throttle-max' which sets the current max cumulative kbps provided for this scene to clients",
"scene-throttle-max - the current max cumulative kbps provided for this scene to clients.\n"
+ "new-client-throttle-max - the max kbps throttle allowed to each new client. Use 'debug lludp throttles set' to set for existing clients.",
HandleSetCommand);
m_console.Commands.AddCommand(
@ -382,7 +385,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
int newThrottleMaxKbps = newValue * 1000 / 8;
m_udpServer.ThrottleRates.Total = newThrottleMaxKbps;
m_udpServer.Scene.ForEachScenePresence(sp =>
{
@ -393,7 +395,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
param, newValue, sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);
LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;
udpClient.FlowThrottle.RequestedDripRate = newThrottleMaxKbps;
udpClient.FlowThrottle.MaxDripRate = newThrottleMaxKbps;
}
});
@ -436,7 +437,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ConsoleDisplayList cdl = new ConsoleDisplayList();
cdl.AddRow("Adaptive throttle", udpClient.FlowThrottle.AdaptiveEnabled);
cdl.AddRow("Max throttle", string.Format("{0} kbps", udpClient.FlowThrottle.RequestedDripRate * 8 / 1000));
cdl.AddRow("Max throttle", string.Format("{0} kbps", udpClient.FlowThrottle.MaxDripRate * 8 / 1000));
m_console.Output(cdl.ToString());
}
@ -456,6 +457,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"scene-throttle-max",
maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset");
int maxClientDripRate = m_udpServer.ThrottleRates.Total;
cdl.AddRow(
"new-client-throttle-max",
maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset");
m_console.Output(cdl.ToString());
}
@ -482,6 +488,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_udpServer.Throttle.RequestedDripRate = newValue * 1000 / 8;
}
else if (param == "new-client-throttle-max")
{
if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, rawValue, out newValue))
return;
m_udpServer.ThrottleRates.Total = newValue * 1000 / 8;
}
else
{
return;
}
m_console.OutputFormat("{0} set to {1} in {2}", param, rawValue, m_udpServer.Scene.Name);
}