OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
/// <summary>
/// Generate UDP Queue data report for each client
/// </summary>
/// <param name="showParams"></param>
/// <returns></returns>
Generate UDP Queue data report for each client
Generate UDP Queue data report for each client
protected string GetQueuesReport(string[] showParams)
        {
            bool showChildren = false;
            string pname = "";
            if (showParams.Length > 2 && showParams[2] == "full")
                showChildren = true;               
            else if (showParams.Length > 3)
                pname = showParams[2] + " " + showParams[3];
            StringBuilder report = new StringBuilder();            
            int columnPadding = 2;
            int maxNameLength = 18;                                    
            int maxRegionNameLength = 14;
            int maxTypeLength = 4;
            int totalInfoFieldsLength
                = maxNameLength + columnPadding
                + maxRegionNameLength + columnPadding
                + maxTypeLength + columnPadding;
            report.Append(GetColumnEntry("User", maxNameLength, columnPadding));
            report.Append(GetColumnEntry("Region", maxRegionNameLength, columnPadding));
            report.Append(GetColumnEntry("Type", maxTypeLength, columnPadding));
            report.AppendFormat(
                "{0,7} {1,7} {2,7} {3,7} {4,9} {5,7} {6,7} {7,7} {8,7} {9,7} {10,8} {11,7}\n",
                "Since",
                "Pkts",
                "Pkts",
                "Pkts",
                "Bytes",
                "Q Pkts",
                "Q Pkts",
                "Q Pkts",
                "Q Pkts",
                "Q Pkts",
                "Q Pkts",
                "Q Pkts");
            report.AppendFormat("{0,-" + totalInfoFieldsLength +  "}", "");
            report.AppendFormat(
                "{0,7} {1,7} {2,7} {3,7} {4,9} {5,7} {6,7} {7,7} {8,7} {9,7} {10,8} {11,7}\n",
                "Last In",
                "In",
                "Out",
                "Resent",
                "Unacked",
                "Resend",
                "Land",
                "Wind",
                "Cloud",
                "Task",
                "Texture",
                "Asset");            
            lock (m_scenes)
            {
                foreach (Scene scene in m_scenes.Values)
                {
                    scene.ForEachClient(
                        delegate(IClientAPI client)
                        {
                            if (client is IStatsCollector)
                            {
                                bool isChild = client.SceneAgent.IsChildAgent;
                                if (isChild && !showChildren)
                                    return;
                                string name = client.Name;
                                if (pname != "" && name != pname)
                                    return;
                                string regionName = scene.RegionInfo.RegionName;
                                report.Append(GetColumnEntry(name, maxNameLength, columnPadding));
                                report.Append(GetColumnEntry(regionName, maxRegionNameLength, columnPadding));
                                report.Append(GetColumnEntry(isChild ? "Cd" : "Rt", maxTypeLength, columnPadding));
                                IStatsCollector stats = (IStatsCollector)client;                            
                                report.AppendLine(stats.Report());
                            }
                        });
                }
            }
            return report.ToString();
        }
protected string GetQueuesReport ( string [ ] showParams ) { bool showChildren = false ; string pname = " " ; if ( showParams . Length > 2 && showParams [ 2 ] == " " ) showChildren = true ; else if ( showParams . Length > 3 ) pname = showParams [ 2 ] + " " + showParams [ 3 ] ; StringBuilder report = new StringBuilder ( ) ; int columnPadding = 2 ; int maxNameLength = 18 ; int maxRegionNameLength = 14 ; int maxTypeLength = 4 ; int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding ; report . Append ( GetColumnEntry ( " " , maxNameLength , columnPadding ) ) ; report . Append ( GetColumnEntry ( " " , maxRegionNameLength , columnPadding ) ) ; report . Append ( GetColumnEntry ( " " , maxTypeLength , columnPadding ) ) ; report . AppendFormat ( " \n " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ) ; report . AppendFormat ( " " + totalInfoFieldsLength + " " , " " ) ; report . AppendFormat ( " \n " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ) ; lock ( m_scenes ) { foreach ( Scene scene in m_scenes . Values ) { scene . ForEachClient ( delegate ( IClientAPI client ) { if ( client is IStatsCollector ) { bool isChild = client . SceneAgent . IsChildAgent ; if ( isChild && ! showChildren ) return ; string name = client . Name ; if ( pname != " " && name != pname ) return ; string regionName = scene . RegionInfo . RegionName ; report . Append ( GetColumnEntry ( name , maxNameLength , columnPadding ) ) ; report . Append ( GetColumnEntry ( regionName , maxRegionNameLength , columnPadding ) ) ; report . Append ( GetColumnEntry ( isChild ? " " : " " , maxTypeLength , columnPadding ) ) ; IStatsCollector stats = ( IStatsCollector ) client ; report . AppendLine ( stats . Report ( ) ) ; } } ) ; } } return report . ToString ( ) ; }
Generate UDP Queue data report for each client
Generate UDP Queue data report for each client
None
showParams
string[]
None