From d9a300fa8e680ec3f41f966e87408e58f3aa0e39 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 14 Jun 2017 20:19:13 +0100 Subject: some cleanup.. remove some stats that only some do look at once on a lifetime --- OpenSim/Framework/ClientInfo.cs | 10 -- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 65 ++---------- .../CoreModules/Avatar/Friends/FriendsModule.cs | 5 +- .../CoreModules/Avatar/Friends/HGFriendsModule.cs | 4 +- .../Agent/UDP/Linden/LindenUDPInfoModule.cs | 110 --------------------- 5 files changed, 13 insertions(+), 181 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs index 98e4465..a1ca9bc 100644 --- a/OpenSim/Framework/ClientInfo.cs +++ b/OpenSim/Framework/ClientInfo.cs @@ -36,14 +36,8 @@ namespace OpenSim.Framework public readonly DateTime StartedTime = DateTime.Now; public AgentCircuitData agentcircuit = null; - public Dictionary needAck; - - public List out_packets = new List(); - public Dictionary pendingAcks = new Dictionary(); public EndPoint proxyEP; - public uint sequence; - public byte[] usecircuit; public EndPoint userEP; public int resendThrottle; @@ -59,9 +53,5 @@ namespace OpenSim.Framework public int targetThrottle; public int maxThrottle; - - public Dictionary SyncRequests = new Dictionary(); - public Dictionary AsyncRequests = new Dictionary(); - public Dictionary GenericRequests = new Dictionary(); } } 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 /// true if the handler was added. This is currently always the case. public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) { - return AddLocalPacketHandler(packetType, handler, doAsync, false); - } - - /// - /// Add a handler for the given packet type. - /// - /// - /// - /// - /// If true, when the packet is received handle it on a different thread. Whether this is given direct to - /// a threadpool thread or placed in a queue depends on the inEngine parameter. - /// - /// - /// If async is false then this parameter is ignored. - /// If async is true and inEngine is false, then the packet is sent directly to a - /// threadpool thread. - /// If async is true and inEngine is true, then the packet is sent to the IncomingPacketAsyncHandlingEngine. - /// This may result in slower handling but reduces the risk of overloading the simulator when there are many - /// simultaneous async requests. - /// - /// true if the handler was added. This is currently always the case. - public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync, bool inEngine) - { bool result = false; lock (m_packetHandlers) { if (!m_packetHandlers.ContainsKey(packetType)) { m_packetHandlers.Add( - packetType, new PacketProcessor() { method = handler, Async = doAsync, InEngine = inEngine }); + packetType, new PacketProcessor() { method = handler, Async = doAsync}); result = true; } } @@ -770,31 +747,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP PacketProcessor pprocessor; if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor)) { - ClientInfo cinfo = UDPClient.GetClientInfo(); //there is a local handler for this packet type if (pprocessor.Async) { - if (!cinfo.AsyncRequests.ContainsKey(packet.Type.ToString())) - cinfo.AsyncRequests[packet.Type.ToString()] = 0; - cinfo.AsyncRequests[packet.Type.ToString()]++; - object obj = new AsyncPacketProcess(this, pprocessor.method, packet); -/* - if (pprocessor.InEngine) - m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); - else - Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); -*/ m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); result = true; } else { - if (!cinfo.SyncRequests.ContainsKey(packet.Type.ToString())) - cinfo.SyncRequests[packet.Type.ToString()] = 0; - cinfo.SyncRequests[packet.Type.ToString()]++; - result = pprocessor.method(this, packet); } } @@ -809,11 +771,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP } if (found) { - ClientInfo cinfo = UDPClient.GetClientInfo(); - if (!cinfo.GenericRequests.ContainsKey(packet.Type.ToString())) - cinfo.GenericRequests[packet.Type.ToString()] = 0; - cinfo.GenericRequests[packet.Type.ToString()]++; - result = method(this, packet); } } @@ -5995,10 +5952,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); - AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage, true, true); - AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest, true, true); + AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); + AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); - AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate, true, true); + AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate); AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply); AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage); AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); @@ -6040,8 +5997,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); - AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect, true, true); - AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect, true, true); + AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect); + AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect); AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); @@ -6185,8 +6142,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete); AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete); AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate); - AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate, true, true); - AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate, true, true); + AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate); + AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); @@ -13436,7 +13393,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP SendAssetNotFound(req); return; } - } if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) @@ -13513,11 +13469,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public bool Async { get; set; } - /// - /// If async is true, should this packet be handled in the async engine or given directly to a threadpool - /// thread? - /// - public bool InEngine { get; set; } } 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 { FriendInfo[] friends = GetFriendsFromCache(principalID); FriendInfo finfo = GetFriend(friends, friendID); - if (finfo != null) + if (finfo != null && finfo.TheirFlags != -1) { return finfo.TheirFlags; } - return 0; } @@ -756,7 +755,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (friend == null) return; - if((friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0) + if(friend.TheirFlags == -1 || (friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0) return; 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 FriendInfo[] friends = GetFriendsFromCache(client.AgentId); foreach (FriendInfo f in friends) { - client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags); + int rights = f.TheirFlags; + if(rights != -1 ) + client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, rights); } } } 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 "Without the 'full' option, only root agents are shown." + " With the 'full' option child agents are also shown.", (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd))); - - scene.AddCommand( - "Comms", this, "show client stats", - "show client stats [first_name last_name]", - "Show client request stats", - "Without the 'first_name last_name' option, all clients are shown." - + " With the 'first_name last_name' option only a specific client is shown.", - (mod, cmd) => MainConsole.Instance.Output(HandleClientStatsReport(cmd))); - } public void RemoveRegion(Scene scene) @@ -540,107 +531,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden return report.ToString(); } - /// - /// Show client stats data - /// - /// - /// - protected string HandleClientStatsReport(string[] showParams) - { - // NOTE: This writes to m_log on purpose. We want to store this information - // in case we need to analyze it later. - // - if (showParams.Length <= 4) - { - m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", "Region", "Name", "Root", "Time", "Reqs/min", "AgentUpdates"); - foreach (Scene scene in m_scenes.Values) - { - scene.ForEachClient( - delegate(IClientAPI client) - { - if (client is LLClientView) - { - LLClientView llClient = client as LLClientView; - ClientInfo cinfo = llClient.UDPClient.GetClientInfo(); - int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); - avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); - - string childAgentStatus; - - if (llClient.SceneAgent != null) - childAgentStatus = llClient.SceneAgent.IsChildAgent ? "N" : "Y"; - else - childAgentStatus = "Off!"; - - m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", - scene.RegionInfo.RegionName, llClient.Name, - childAgentStatus, - (DateTime.Now - cinfo.StartedTime).Minutes, - avg_reqs, - string.Format( - "{0} ({1:0.00}%)", - llClient.TotalAgentUpdates, - cinfo.SyncRequests.ContainsKey("AgentUpdate") - ? (float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100 - : 0)); - } - }); - } - return string.Empty; - } - - string fname = "", lname = ""; - - if (showParams.Length > 3) - fname = showParams[3]; - if (showParams.Length > 4) - lname = showParams[4]; - - foreach (Scene scene in m_scenes.Values) - { - scene.ForEachClient( - delegate(IClientAPI client) - { - if (client is LLClientView) - { - LLClientView llClient = client as LLClientView; - - if (llClient.Name == fname + " " + lname) - { - - ClientInfo cinfo = llClient.GetClientInfo(); - AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(llClient.CircuitCode); - if (aCircuit == null) // create a dummy one - aCircuit = new AgentCircuitData(); - - if (!llClient.SceneAgent.IsChildAgent) - m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0); - - int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); - avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); - - m_log.InfoFormat("[INFO]:"); - m_log.InfoFormat("[INFO]: {0} # {1} # Time: {2}min # Avg Reqs/min: {3}", scene.RegionInfo.RegionName, - (llClient.SceneAgent.IsChildAgent ? "Child" : "Root"), (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs); - - Dictionary sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry) - .ToDictionary(pair => pair.Key, pair => pair.Value); - PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum()); - - sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry) - .ToDictionary(pair => pair.Key, pair => pair.Value); - PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum()); - - sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry) - .ToDictionary(pair => pair.Key, pair => pair.Value); - PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum()); - } - } - }); - } - return string.Empty; - } - private void PrintRequests(string type, Dictionary sortedDict, int sum) { m_log.InfoFormat("[INFO]:"); -- cgit v1.1