From a5eabdade3498d41d600043fe15d62905bec24be Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 6 Oct 2014 22:18:54 +0100 Subject: Move information about "server agent rate" throttles into "show server throttles" command rather than "show throttles" THis allows us to see the rates when no client is connected to the region. --- .../ClientStack/Linden/UDP/LLUDPServerCommands.cs | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs index 354a47d..438331a 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServerCommands.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Text; using NDesk.Options; using OpenSim.Framework; using OpenSim.Framework.Console; @@ -174,6 +175,62 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_udpServer.MaxTotalDripRate != 0 ? string.Format("{0} kbit", m_udpServer.MaxTotalDripRate / 8 / 1000) : "unset"); m_console.Output(cdl.ToString()); + + m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer)); + } + + private string GetServerThrottlesReport(LLUDPServer udpServer) + { + StringBuilder report = new StringBuilder(); + + report.AppendFormat( + "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}\n", + "Max", + "Total", + "Resend", + "Land", + "Wind", + "Cloud", + "Task", + "Texture", + "Asset"); + + report.AppendFormat( + "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}\n", + "kb/s", + "kb/s", + "kb/s", + "kb/s", + "kb/s", + "kb/s", + "kb/s", + "kb/s", + "kb/s"); + + report.AppendLine(); + + ThrottleRates throttleRates = udpServer.ThrottleRates; + report.AppendFormat( + "{0,8} {1,7} {2,8} {3,7} {4,7} {5,7} {6,7} {7,9} {8,7}", + "-", + (throttleRates.Total * 8) / 1000, + (throttleRates.Resend * 8) / 1000, + (throttleRates.Land * 8) / 1000, + (throttleRates.Wind * 8) / 1000, + (throttleRates.Cloud * 8) / 1000, + (throttleRates.Task * 8) / 1000, + (throttleRates.Texture * 8) / 1000, + (throttleRates.Asset * 8) / 1000); + + return report.ToString(); + } + + protected string GetColumnEntry(string entry, int maxLength, int columnPadding) + { + return string.Format( + "{0,-" + maxLength + "}{1,-" + columnPadding + "}", + entry.Length > maxLength ? entry.Substring(0, maxLength) : entry, + ""); } private void HandleDataCommand(string module, string[] args) -- cgit v1.1