Add "show server throttles" command for showing server specific information about throttles
This is separate from the user-oriented "show throttles" command since one will often only want to know about varying client throttle settings. Currently displays max scene throttle and adaptive throttles config if set.ghosts
parent
c3b1c72c33
commit
026df644b5
|
@ -248,6 +248,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// <summary>Bandwidth throttle for this UDP server</summary>
|
||||
protected TokenBucket m_throttle;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum total drip rate allowed to all clients.
|
||||
/// </summary>
|
||||
public long MaxTotalDripRate { get { return m_throttle.RequestedDripRate; } }
|
||||
|
||||
/// <summary>Bandwidth throttle rates for this UDP server</summary>
|
||||
public ThrottleRates ThrottleRates { get; private set; }
|
||||
|
||||
|
|
|
@ -47,6 +47,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public void Register()
|
||||
{
|
||||
m_console.Commands.AddCommand(
|
||||
"Comms", false, "show server throttles",
|
||||
"show server throttles",
|
||||
"Show information about server throttles",
|
||||
HandleShowServerThrottlesCommand);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"Debug", false, "debug lludp packet",
|
||||
"debug lludp packet [--default | --all] <level> [<avatar-first-name> <avatar-last-name>]",
|
||||
|
@ -155,6 +161,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
HandleAgentUpdateCommand);
|
||||
}
|
||||
|
||||
private void HandleShowServerThrottlesCommand(string module, string[] args)
|
||||
{
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||
return;
|
||||
|
||||
m_console.OutputFormat("Throttles for {0}", m_udpServer.Scene.Name);
|
||||
ConsoleDisplayList cdl = new ConsoleDisplayList();
|
||||
cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled);
|
||||
cdl.AddRow(
|
||||
"Max scene throttle",
|
||||
m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbit", m_udpServer.MaxTotalDripRate / 8 / 1000) : "unset");
|
||||
|
||||
m_console.Output(cdl.ToString());
|
||||
}
|
||||
|
||||
private void HandleDataCommand(string module, string[] args)
|
||||
{
|
||||
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
|
||||
|
|
Loading…
Reference in New Issue