aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-06-14 20:19:13 +0100
committerUbitUmarov2017-06-14 20:19:13 +0100
commitd9a300fa8e680ec3f41f966e87408e58f3aa0e39 (patch)
tree9cd459dda394a3f4ec8bfe258127269214806645 /OpenSim/Region
parent remove options about script compilers the got back somehow on defaults also (diff)
downloadopensim-SC-d9a300fa8e680ec3f41f966e87408e58f3aa0e39.zip
opensim-SC-d9a300fa8e680ec3f41f966e87408e58f3aa0e39.tar.gz
opensim-SC-d9a300fa8e680ec3f41f966e87408e58f3aa0e39.tar.bz2
opensim-SC-d9a300fa8e680ec3f41f966e87408e58f3aa0e39.tar.xz
some cleanup.. remove some stats that only some do look at once on a lifetime
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs65
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs110
4 files changed, 13 insertions, 171 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 54359eb..01c1fb9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -706,36 +706,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
706 /// <returns>true if the handler was added. This is currently always the case.</returns> 706 /// <returns>true if the handler was added. This is currently always the case.</returns>
707 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) 707 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync)
708 { 708 {
709 return AddLocalPacketHandler(packetType, handler, doAsync, false);
710 }
711
712 /// <summary>
713 /// Add a handler for the given packet type.
714 /// </summary>
715 /// <param name="packetType"></param>
716 /// <param name="handler"></param>
717 /// <param name="doAsync">
718 /// If true, when the packet is received handle it on a different thread. Whether this is given direct to
719 /// a threadpool thread or placed in a queue depends on the inEngine parameter.
720 /// </param>
721 /// <param name="inEngine">
722 /// If async is false then this parameter is ignored.
723 /// If async is true and inEngine is false, then the packet is sent directly to a
724 /// threadpool thread.
725 /// If async is true and inEngine is true, then the packet is sent to the IncomingPacketAsyncHandlingEngine.
726 /// This may result in slower handling but reduces the risk of overloading the simulator when there are many
727 /// simultaneous async requests.
728 /// </param>
729 /// <returns>true if the handler was added. This is currently always the case.</returns>
730 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync, bool inEngine)
731 {
732 bool result = false; 709 bool result = false;
733 lock (m_packetHandlers) 710 lock (m_packetHandlers)
734 { 711 {
735 if (!m_packetHandlers.ContainsKey(packetType)) 712 if (!m_packetHandlers.ContainsKey(packetType))
736 { 713 {
737 m_packetHandlers.Add( 714 m_packetHandlers.Add(
738 packetType, new PacketProcessor() { method = handler, Async = doAsync, InEngine = inEngine }); 715 packetType, new PacketProcessor() { method = handler, Async = doAsync});
739 result = true; 716 result = true;
740 } 717 }
741 } 718 }
@@ -770,31 +747,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
770 PacketProcessor pprocessor; 747 PacketProcessor pprocessor;
771 if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor)) 748 if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor))
772 { 749 {
773 ClientInfo cinfo = UDPClient.GetClientInfo();
774 750
775 //there is a local handler for this packet type 751 //there is a local handler for this packet type
776 if (pprocessor.Async) 752 if (pprocessor.Async)
777 { 753 {
778 if (!cinfo.AsyncRequests.ContainsKey(packet.Type.ToString()))
779 cinfo.AsyncRequests[packet.Type.ToString()] = 0;
780 cinfo.AsyncRequests[packet.Type.ToString()]++;
781
782 object obj = new AsyncPacketProcess(this, pprocessor.method, packet); 754 object obj = new AsyncPacketProcess(this, pprocessor.method, packet);
783/*
784 if (pprocessor.InEngine)
785 m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
786 else
787 Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString());
788*/
789 m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); 755 m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj));
790 result = true; 756 result = true;
791 } 757 }
792 else 758 else
793 { 759 {
794 if (!cinfo.SyncRequests.ContainsKey(packet.Type.ToString()))
795 cinfo.SyncRequests[packet.Type.ToString()] = 0;
796 cinfo.SyncRequests[packet.Type.ToString()]++;
797
798 result = pprocessor.method(this, packet); 760 result = pprocessor.method(this, packet);
799 } 761 }
800 } 762 }
@@ -809,11 +771,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
809 } 771 }
810 if (found) 772 if (found)
811 { 773 {
812 ClientInfo cinfo = UDPClient.GetClientInfo();
813 if (!cinfo.GenericRequests.ContainsKey(packet.Type.ToString()))
814 cinfo.GenericRequests[packet.Type.ToString()] = 0;
815 cinfo.GenericRequests[packet.Type.ToString()]++;
816
817 result = method(this, packet); 774 result = method(this, packet);
818 } 775 }
819 } 776 }
@@ -5995,10 +5952,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5995 AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); 5952 AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false);
5996 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); 5953 AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
5997 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); 5954 AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
5998 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage, true, true); 5955 AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
5999 AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest, true, true); 5956 AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest);
6000 AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); 5957 AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
6001 AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate, true, true); 5958 AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate);
6002 AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply); 5959 AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply);
6003 AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage); 5960 AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage);
6004 AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); 5961 AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship);
@@ -6040,8 +5997,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6040 AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); 5997 AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams);
6041 AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); 5998 AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate);
6042 AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); 5999 AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects);
6043 AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect, true, true); 6000 AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect);
6044 AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect, true, true); 6001 AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect);
6045 AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); 6002 AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition);
6046 AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); 6003 AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale);
6047 AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); 6004 AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation);
@@ -6185,8 +6142,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6185 AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete); 6142 AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete);
6186 AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete); 6143 AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete);
6187 AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate); 6144 AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate);
6188 AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate, true, true); 6145 AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate);
6189 AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate, true, true); 6146 AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate);
6190 AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); 6147 AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights);
6191 AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); 6148 AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery);
6192 AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); 6149 AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry);
@@ -13436,7 +13393,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
13436 SendAssetNotFound(req); 13393 SendAssetNotFound(req);
13437 return; 13394 return;
13438 } 13395 }
13439
13440 } 13396 }
13441 13397
13442 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) 13398 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
@@ -13513,11 +13469,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
13513 /// </summary> 13469 /// </summary>
13514 public bool Async { get; set; } 13470 public bool Async { get; set; }
13515 13471
13516 /// <summary>
13517 /// If async is true, should this packet be handled in the async engine or given directly to a threadpool
13518 /// thread?
13519 /// </summary>
13520 public bool InEngine { get; set; }
13521 } 13472 }
13522 13473
13523 public class AsyncPacketProcess 13474 public class AsyncPacketProcess
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 91f19e3..772485c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -247,11 +247,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
247 { 247 {
248 FriendInfo[] friends = GetFriendsFromCache(principalID); 248 FriendInfo[] friends = GetFriendsFromCache(principalID);
249 FriendInfo finfo = GetFriend(friends, friendID); 249 FriendInfo finfo = GetFriend(friends, friendID);
250 if (finfo != null) 250 if (finfo != null && finfo.TheirFlags != -1)
251 { 251 {
252 return finfo.TheirFlags; 252 return finfo.TheirFlags;
253 } 253 }
254
255 return 0; 254 return 0;
256 } 255 }
257 256
@@ -756,7 +755,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
756 if (friend == null) 755 if (friend == null)
757 return; 756 return;
758 757
759 if((friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0) 758 if(friend.TheirFlags == -1 || (friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0)
760 return; 759 return;
761 760
762 Scene hunterScene = (Scene)remoteClient.Scene; 761 Scene hunterScene = (Scene)remoteClient.Scene;
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index 82154bc..fae1e05 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -214,7 +214,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
214 FriendInfo[] friends = GetFriendsFromCache(client.AgentId); 214 FriendInfo[] friends = GetFriendsFromCache(client.AgentId);
215 foreach (FriendInfo f in friends) 215 foreach (FriendInfo f in friends)
216 { 216 {
217 client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags); 217 int rights = f.TheirFlags;
218 if(rights != -1 )
219 client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, rights);
218 } 220 }
219 } 221 }
220 } 222 }
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index 3be5a07..490809e 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -124,15 +124,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
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) => MainConsole.Instance.Output(GetThrottlesReport(cmd))); 126 (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd)));
127
128 scene.AddCommand(
129 "Comms", this, "show client stats",
130 "show client stats [first_name last_name]",
131 "Show client request stats",
132 "Without the 'first_name last_name' option, all clients are shown."
133 + " With the 'first_name last_name' option only a specific client is shown.",
134 (mod, cmd) => MainConsole.Instance.Output(HandleClientStatsReport(cmd)));
135
136 } 127 }
137 128
138 public void RemoveRegion(Scene scene) 129 public void RemoveRegion(Scene scene)
@@ -540,107 +531,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden
540 return report.ToString(); 531 return report.ToString();
541 } 532 }
542 533
543 /// <summary>
544 /// Show client stats data
545 /// </summary>
546 /// <param name="showParams"></param>
547 /// <returns></returns>
548 protected string HandleClientStatsReport(string[] showParams)
549 {
550 // NOTE: This writes to m_log on purpose. We want to store this information
551 // in case we need to analyze it later.
552 //
553 if (showParams.Length <= 4)
554 {
555 m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", "Region", "Name", "Root", "Time", "Reqs/min", "AgentUpdates");
556 foreach (Scene scene in m_scenes.Values)
557 {
558 scene.ForEachClient(
559 delegate(IClientAPI client)
560 {
561 if (client is LLClientView)
562 {
563 LLClientView llClient = client as LLClientView;
564 ClientInfo cinfo = llClient.UDPClient.GetClientInfo();
565 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
566 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
567
568 string childAgentStatus;
569
570 if (llClient.SceneAgent != null)
571 childAgentStatus = llClient.SceneAgent.IsChildAgent ? "N" : "Y";
572 else
573 childAgentStatus = "Off!";
574
575 m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}",
576 scene.RegionInfo.RegionName, llClient.Name,
577 childAgentStatus,
578 (DateTime.Now - cinfo.StartedTime).Minutes,
579 avg_reqs,
580 string.Format(
581 "{0} ({1:0.00}%)",
582 llClient.TotalAgentUpdates,
583 cinfo.SyncRequests.ContainsKey("AgentUpdate")
584 ? (float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100
585 : 0));
586 }
587 });
588 }
589 return string.Empty;
590 }
591
592 string fname = "", lname = "";
593
594 if (showParams.Length > 3)
595 fname = showParams[3];
596 if (showParams.Length > 4)
597 lname = showParams[4];
598
599 foreach (Scene scene in m_scenes.Values)
600 {
601 scene.ForEachClient(
602 delegate(IClientAPI client)
603 {
604 if (client is LLClientView)
605 {
606 LLClientView llClient = client as LLClientView;
607
608 if (llClient.Name == fname + " " + lname)
609 {
610
611 ClientInfo cinfo = llClient.GetClientInfo();
612 AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(llClient.CircuitCode);
613 if (aCircuit == null) // create a dummy one
614 aCircuit = new AgentCircuitData();
615
616 if (!llClient.SceneAgent.IsChildAgent)
617 m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0);
618
619 int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum();
620 avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1);
621
622 m_log.InfoFormat("[INFO]:");
623 m_log.InfoFormat("[INFO]: {0} # {1} # Time: {2}min # Avg Reqs/min: {3}", scene.RegionInfo.RegionName,
624 (llClient.SceneAgent.IsChildAgent ? "Child" : "Root"), (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs);
625
626 Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry)
627 .ToDictionary(pair => pair.Key, pair => pair.Value);
628 PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum());
629
630 sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry)
631 .ToDictionary(pair => pair.Key, pair => pair.Value);
632 PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum());
633
634 sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry)
635 .ToDictionary(pair => pair.Key, pair => pair.Value);
636 PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum());
637 }
638 }
639 });
640 }
641 return string.Empty;
642 }
643
644 private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum) 534 private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum)
645 { 535 {
646 m_log.InfoFormat("[INFO]:"); 536 m_log.InfoFormat("[INFO]:");