aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/UDP/Linden
diff options
context:
space:
mode:
authorDiva Canto2013-07-10 17:14:20 -0700
committerDiva Canto2013-07-10 17:14:20 -0700
commitbdaeb02863cb56e0d543b1e97eb3356571911f90 (patch)
tree9508e147a748cbac97f2ed72d2ba270551e14c76 /OpenSim/Region/OptionalModules/Agent/UDP/Linden
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-bdaeb02863cb56e0d543b1e97eb3356571911f90.zip
opensim-SC_OLD-bdaeb02863cb56e0d543b1e97eb3356571911f90.tar.gz
opensim-SC_OLD-bdaeb02863cb56e0d543b1e97eb3356571911f90.tar.bz2
opensim-SC_OLD-bdaeb02863cb56e0d543b1e97eb3356571911f90.tar.xz
show client stats: Fixed the requests/min. Also changed the spelling of the command, not without the dash.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/UDP/Linden')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs43
1 files changed, 22 insertions, 21 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index b1aec81..79509ab 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -133,8 +133,8 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
133 HandleEmergencyMonitoring); 133 HandleEmergencyMonitoring);
134 134
135 scene.AddCommand( 135 scene.AddCommand(
136 "Comms", this, "show client-stats", 136 "Comms", this, "show client stats",
137 "show client-stats [first_name last_name]", 137 "show client stats [first_name last_name]",
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.",
@@ -609,7 +609,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
609 // NOTE: This writes to m_log on purpose. We want to store this information 609 // NOTE: This writes to m_log on purpose. We want to store this information
610 // in case we need to analyze it later. 610 // in case we need to analyze it later.
611 // 611 //
612 if (showParams.Length <= 3) 612 if (showParams.Length <= 4)
613 { 613 {
614 m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,6} {3,11} {4, 10}", "Region", "Name", "Root", "Time", "Reqs/min"); 614 m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,6} {3,11} {4, 10}", "Region", "Name", "Root", "Time", "Reqs/min");
615 foreach (Scene scene in m_scenes.Values) 615 foreach (Scene scene in m_scenes.Values)
@@ -621,7 +621,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
621 { 621 {
622 LLClientView llClient = client as LLClientView; 622 LLClientView llClient = client as LLClientView;
623 ClientInfo cinfo = llClient.UDPClient.GetClientInfo(); 623 ClientInfo cinfo = llClient.UDPClient.GetClientInfo();
624 int avg_reqs = cinfo.AsyncRequests.Count + cinfo.GenericRequests.Count + cinfo.SyncRequests.Count; 624 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
625 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); 625 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
626 626
627 m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,4} {3,9}min {4,10}", 627 m_log.InfoFormat("[INFO]: {0,-12} {1,20} {2,4} {3,9}min {4,10}",
@@ -635,10 +635,10 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
635 635
636 string fname = "", lname = ""; 636 string fname = "", lname = "";
637 637
638 if (showParams.Length > 2)
639 fname = showParams[2];
640 if (showParams.Length > 3) 638 if (showParams.Length > 3)
641 lname = showParams[3]; 639 fname = showParams[3];
640 if (showParams.Length > 4)
641 lname = showParams[4];
642 642
643 foreach (Scene scene in m_scenes.Values) 643 foreach (Scene scene in m_scenes.Values)
644 { 644 {
@@ -660,7 +660,7 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
660 if (!llClient.SceneAgent.IsChildAgent) 660 if (!llClient.SceneAgent.IsChildAgent)
661 m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0); 661 m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, aCircuit.Viewer, aCircuit.Id0);
662 662
663 int avg_reqs = cinfo.AsyncRequests.Count + cinfo.GenericRequests.Count + cinfo.SyncRequests.Count; 663 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
664 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); 664 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
665 665
666 m_log.InfoFormat("[INFO]:"); 666 m_log.InfoFormat("[INFO]:");
@@ -669,29 +669,30 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
669 669
670 Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry) 670 Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry)
671 .ToDictionary(pair => pair.Key, pair => pair.Value); 671 .ToDictionary(pair => pair.Key, pair => pair.Value);
672 PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum());
672 673
673 m_log.InfoFormat("[INFO]: {0,25}", "TOP ASYNC");
674 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
675 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
676
677 m_log.InfoFormat("[INFO]:");
678 sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry) 674 sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry)
679 .ToDictionary(pair => pair.Key, pair => pair.Value); 675 .ToDictionary(pair => pair.Key, pair => pair.Value);
680 m_log.InfoFormat("[INFO]: {0,25}", "TOP SYNC"); 676 PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum());
681 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
682 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
683 677
684 m_log.InfoFormat("[INFO]:");
685 sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry) 678 sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry)
686 .ToDictionary(pair => pair.Key, pair => pair.Value); 679 .ToDictionary(pair => pair.Key, pair => pair.Value);
687 m_log.InfoFormat("[INFO]: {0,25}", "TOP GENERIC"); 680 PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum());
688 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
689 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
690 } 681 }
691 } 682 }
692 }); 683 });
693 } 684 }
694 return string.Empty; 685 return string.Empty;
695 } 686 }
687
688 private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum)
689 {
690 m_log.InfoFormat("[INFO]:");
691 m_log.InfoFormat("[INFO]: {0,25}", type);
692 foreach (KeyValuePair<string, int> kvp in sortedDict.Take(12))
693 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", kvp.Key, kvp.Value);
694 m_log.InfoFormat("[INFO]: {0,25}", "...");
695 m_log.InfoFormat("[INFO]: {0,25} {1,-6}", "Total", sum);
696 }
696 } 697 }
697} \ No newline at end of file 698} \ No newline at end of file