aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-25 01:56:41 +0100
committerJustin Clark-Casey (justincc)2014-07-25 01:56:41 +0100
commitcc61681484185f3c450fc0ab7efeb093c672d194 (patch)
tree2d93250717a8b4beedbce820bf432d8b1bfd877f /OpenSim/Region/OptionalModules
parentAdd missing default female hair texture for Ruth avatar. (diff)
downloadopensim-SC_OLD-cc61681484185f3c450fc0ab7efeb093c672d194.zip
opensim-SC_OLD-cc61681484185f3c450fc0ab7efeb093c672d194.tar.gz
opensim-SC_OLD-cc61681484185f3c450fc0ab7efeb093c672d194.tar.bz2
opensim-SC_OLD-cc61681484185f3c450fc0ab7efeb093c672d194.tar.xz
Revert "Write UDP statistics to the log, not just the console (e.g., "show queues")"
Fixes http://opensimulator.org/mantis/view.php?id=7280 It can't be done this way because the stats data needs to show up on the console at all log levels, not just debug. But this means setting it to log at fatal, which is not appropriate for this stuff in the log. I understand the desire but this has to be done some other way, perhaps by (yet another) config parameter. Also, this was already being done with the ClientStatsReport but that also should be done in another way, I think. This reverts commit 5d534127663899cd5592c865b1d00855fce25854.
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs69
1 files changed, 32 insertions, 37 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 6e8a1bf..2ef3c4c 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -87,8 +87,8 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
87 "show pqueues [full]", 87 "show pqueues [full]",
88 "Show priority queue data for each client", 88 "Show priority queue data for each client",
89 "Without the 'full' option, only root agents are shown." 89 "Without the 'full' option, only root agents are shown."
90 + " With the 'full' option child agents are also shown.", 90 + " With the 'full' option child agents are also shown.",
91 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + GetPQueuesReport(cmd))); 91 (mod, cmd) => MainConsole.Instance.Output(GetPQueuesReport(cmd)));
92 92
93 scene.AddCommand( 93 scene.AddCommand(
94 "Comms", this, "show queues", 94 "Comms", this, "show queues",
@@ -103,27 +103,27 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
103 + "Pkts Resent - Number of packets resent to the client.\n" 103 + "Pkts Resent - Number of packets resent to the client.\n"
104 + "Bytes Unacked - Number of bytes transferred to the client that are awaiting acknowledgement.\n" 104 + "Bytes Unacked - Number of bytes transferred to the client that are awaiting acknowledgement.\n"
105 + "Q Pkts * - Number of packets of various types (land, wind, etc.) to be sent to the client that are waiting for available bandwidth.\n", 105 + "Q Pkts * - Number of packets of various types (land, wind, etc.) to be sent to the client that are waiting for available bandwidth.\n",
106 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + GetQueuesReport(cmd))); 106 (mod, cmd) => MainConsole.Instance.Output(GetQueuesReport(cmd)));
107 107
108 scene.AddCommand( 108 scene.AddCommand(
109 "Comms", this, "show image queues", 109 "Comms", this, "show image queues",
110 "show image queues <first-name> <last-name>", 110 "show image queues <first-name> <last-name>",
111 "Show the image queues (textures downloaded via UDP) for a particular client.", 111 "Show the image queues (textures downloaded via UDP) for a particular client.",
112 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + GetImageQueuesReport(cmd))); 112 (mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd)));
113 113
114 scene.AddCommand( 114 scene.AddCommand(
115 "Comms", this, "clear image queues", 115 "Comms", this, "clear image queues",
116 "clear image queues <first-name> <last-name>", 116 "clear image queues <first-name> <last-name>",
117 "Clear the image queues (textures downloaded via UDP) for a particular client.", 117 "Clear the image queues (textures downloaded via UDP) for a particular client.",
118 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + HandleImageQueuesClear(cmd))); 118 (mod, cmd) => MainConsole.Instance.Output(HandleImageQueuesClear(cmd)));
119 119
120 scene.AddCommand( 120 scene.AddCommand(
121 "Comms", this, "show throttles", 121 "Comms", this, "show throttles",
122 "show throttles [full]", 122 "show throttles [full]",
123 "Show throttle settings for each client and for the server overall", 123 "Show throttle settings for each client and for the server overall",
124 "Without the 'full' option, only root agents are shown." 124 "Without the 'full' option, only root agents are shown."
125 + " With the 'full' option child agents are also shown.", 125 + " With the 'full' option child agents are also shown.",
126 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + GetThrottlesReport(cmd))); 126 (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd)));
127 127
128 scene.AddCommand( 128 scene.AddCommand(
129 "Comms", this, "emergency-monitoring", 129 "Comms", this, "emergency-monitoring",
@@ -138,7 +138,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
138 "Show client request stats", 138 "Show client request stats",
139 "Without the 'first_name last_name' option, all clients are shown." 139 "Without the 'first_name last_name' option, all clients are shown."
140 + " With the 'first_name last_name' option only a specific client is shown.", 140 + " With the 'first_name last_name' option only a specific client is shown.",
141 (mod, cmd) => m_log.Debug(string.Join(" ", cmd) + "\n" + HandleClientStatsReport(cmd))); 141 (mod, cmd) => MainConsole.Instance.Output(HandleClientStatsReport(cmd)));
142 142
143 } 143 }
144 144
@@ -279,7 +279,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
279 return; 279 return;
280 280
281 string name = client.Name; 281 string name = client.Name;
282 if (pname != "" && name.ToLower() != pname.ToLower()) 282 if (pname != "" && name != pname)
283 return; 283 return;
284 284
285 string regionName = scene.RegionInfo.RegionName; 285 string regionName = scene.RegionInfo.RegionName;
@@ -440,7 +440,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
440 return; 440 return;
441 441
442 string name = client.Name; 442 string name = client.Name;
443 if (pname != "" && name.ToLower() != pname.ToLower()) 443 if (pname != "" && name != pname)
444 return; 444 return;
445 445
446 string regionName = scene.RegionInfo.RegionName; 446 string regionName = scene.RegionInfo.RegionName;
@@ -537,7 +537,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
537 return; 537 return;
538 538
539 string name = client.Name; 539 string name = client.Name;
540 if (pname != "" && name.ToLower() != pname.ToLower()) 540 if (pname != "" && name != pname)
541 return; 541 return;
542 542
543 string regionName = scene.RegionInfo.RegionName; 543 string regionName = scene.RegionInfo.RegionName;
@@ -608,12 +608,12 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
608 /// <returns></returns> 608 /// <returns></returns>
609 protected string HandleClientStatsReport(string[] showParams) 609 protected string HandleClientStatsReport(string[] showParams)
610 { 610 {
611 StringBuilder report = new StringBuilder(); 611 // NOTE: This writes to m_log on purpose. We want to store this information
612 612 // in case we need to analyze it later.
613 //
613 if (showParams.Length <= 4) 614 if (showParams.Length <= 4)
614 { 615 {
615 report.AppendFormat("{0,-30} {1,-30} {2,-6} {3,-11} {4,-11} {5,-16}\n", "Region", "Name", "Root", "Time", "Reqs/min", "AgentUpdates"); 616 m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", "Region", "Name", "Root", "Time", "Reqs/min", "AgentUpdates");
616
617 foreach (Scene scene in m_scenes.Values) 617 foreach (Scene scene in m_scenes.Values)
618 { 618 {
619 scene.ForEachClient( 619 scene.ForEachClient(
@@ -633,10 +633,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
633 else 633 else
634 childAgentStatus = "Off!"; 634 childAgentStatus = "Off!";
635 635
636 int agentUpdates = 0; 636 m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}",
637 cinfo.SyncRequests.TryGetValue("AgentUpdate", out agentUpdates);
638
639 report.AppendFormat("{0,-30} {1,-30} {2,-6} {3,-11} {4,-11} {5,-16}\n",
640 scene.RegionInfo.RegionName, llClient.Name, 637 scene.RegionInfo.RegionName, llClient.Name,
641 childAgentStatus, 638 childAgentStatus,
642 (DateTime.Now - cinfo.StartedTime).Minutes, 639 (DateTime.Now - cinfo.StartedTime).Minutes,
@@ -644,12 +641,11 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
644 string.Format( 641 string.Format(
645 "{0} ({1:0.00}%)", 642 "{0} ({1:0.00}%)",
646 llClient.TotalAgentUpdates, 643 llClient.TotalAgentUpdates,
647 ((float)agentUpdates) / llClient.TotalAgentUpdates * 100)); 644 (float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100));
648 } 645 }
649 }); 646 });
650 } 647 }
651 648 return string.Empty;
652 return report.ToString();
653 } 649 }
654 650
655 string fname = "", lname = ""; 651 string fname = "", lname = "";
@@ -668,7 +664,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
668 { 664 {
669 LLClientView llClient = client as LLClientView; 665 LLClientView llClient = client as LLClientView;
670 666
671 if (llClient.Name.ToLower() == (fname + " " + lname).ToLower()) 667 if (llClient.Name == fname + " " + lname)
672 { 668 {
673 669
674 ClientInfo cinfo = llClient.GetClientInfo(); 670 ClientInfo cinfo = llClient.GetClientInfo();
@@ -677,42 +673,41 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
677 aCircuit = new AgentCircuitData(); 673 aCircuit = new AgentCircuitData();
678 674
679 if (!llClient.SceneAgent.IsChildAgent) 675 if (!llClient.SceneAgent.IsChildAgent)
680 report.AppendFormat("{0} # {1} # {2}\n", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0); 676 m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0);
681 677
682 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); 678 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
683 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); 679 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
684 680
685 report.AppendLine(); 681 m_log.InfoFormat("[INFO]:");
686 report.AppendFormat("{0} # {1} # Time: {2}min # Avg Reqs/min: {3}\n", scene.RegionInfo.RegionName, 682 m_log.InfoFormat("[INFO]: {0} # {1} # Time: {2}min # Avg Reqs/min: {3}", scene.RegionInfo.RegionName,
687 (llClient.SceneAgent.IsChildAgent ? "Child" : "Root"), (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs); 683 (llClient.SceneAgent.IsChildAgent ? "Child" : "Root"), (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs);
688 684
689 Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry) 685 Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry)
690 .ToDictionary(pair => pair.Key, pair => pair.Value); 686 .ToDictionary(pair => pair.Key, pair => pair.Value);
691 PrintRequests(report, "TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum()); 687 PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum());
692 688
693 sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry) 689 sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry)
694 .ToDictionary(pair => pair.Key, pair => pair.Value); 690 .ToDictionary(pair => pair.Key, pair => pair.Value);
695 PrintRequests(report, "TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum()); 691 PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum());
696 692
697 sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry) 693 sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry)
698 .ToDictionary(pair => pair.Key, pair => pair.Value); 694 .ToDictionary(pair => pair.Key, pair => pair.Value);
699 PrintRequests(report, "TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum()); 695 PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum());
700 } 696 }
701 } 697 }
702 }); 698 });
703 } 699 }
704 700 return string.Empty;
705 return report.ToString();
706 } 701 }
707 702
708 private void PrintRequests(StringBuilder report, string type, Dictionary<string, int> sortedDict, int sum) 703 private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum)
709 { 704 {
710 report.AppendLine(); 705 m_log.InfoFormat("[INFO]:");
711 report.AppendFormat("{0,25}\n", type); 706 m_log.InfoFormat("[INFO]: {0,25}", type);
712 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12)) 707 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
713 report.AppendFormat("{0,25} {1,-6}\n", kvp.Key, kvp.Value); 708 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
714 report.AppendFormat("{0,25}\n", "..."); 709 m_log.InfoFormat("[INFO]: {0,25}", "...");
715 report.AppendFormat("{0,25} {1,-6}\n", "Total", sum); 710 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", "Total", sum);
716 } 711 }
717 } 712 }
718} 713}