diff options
author | Justin Clark-Casey (justincc) | 2013-03-25 21:24:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-03-25 21:53:27 +0000 |
commit | 128c72a23437423d87cc9b10815f96d7362bddd1 (patch) | |
tree | 1e701b3a29cc10ce7358d8c404bd1fd6048a6279 /OpenSim/Region/CoreModules | |
parent | Fix teleporting into the non-SW 256x256 corner of a megaregion, though curren... (diff) | |
download | opensim-SC_OLD-128c72a23437423d87cc9b10815f96d7362bddd1.zip opensim-SC_OLD-128c72a23437423d87cc9b10815f96d7362bddd1.tar.gz opensim-SC_OLD-128c72a23437423d87cc9b10815f96d7362bddd1.tar.bz2 opensim-SC_OLD-128c72a23437423d87cc9b10815f96d7362bddd1.tar.xz |
Start recording inter-region teleport attempts, aborts, cancels and failures in statistics for monitoring/debugging purposes
These are recorded as 'entitytransfer' stats as seen by the "show stats entitytransfer" console command.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 119 |
1 files changed, 109 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 136caad..4cf7645 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -33,6 +33,7 @@ using System.Threading; | |||
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Capabilities; | 34 | using OpenSim.Framework.Capabilities; |
35 | using OpenSim.Framework.Client; | 35 | using OpenSim.Framework.Client; |
36 | using OpenSim.Framework.Monitoring; | ||
36 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.Physics.Manager; |
@@ -77,6 +78,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
77 | /// </remarks> | 78 | /// </remarks> |
78 | public bool DisableInterRegionTeleportCancellation { get; set; } | 79 | public bool DisableInterRegionTeleportCancellation { get; set; } |
79 | 80 | ||
81 | /// <summary> | ||
82 | /// Number of times inter-region teleport was attempted. | ||
83 | /// </summary> | ||
84 | private Stat m_interRegionTeleportAttempts; | ||
85 | |||
86 | /// <summary> | ||
87 | /// Number of times inter-region teleport was aborted (due to simultaneous client logout). | ||
88 | /// </summary> | ||
89 | private Stat m_interRegionTeleportAborts; | ||
90 | |||
91 | /// <summary> | ||
92 | /// Number of times inter-region teleport was successfully cancelled by the client. | ||
93 | /// </summary> | ||
94 | private Stat m_interRegionTeleportCancels; | ||
95 | |||
96 | /// <summary> | ||
97 | /// Number of times inter-region teleport failed due to server/client/network problems (e.g. viewer failed to | ||
98 | /// connect with destination region). | ||
99 | /// </summary> | ||
100 | /// <remarks> | ||
101 | /// This is not necessarily a problem for this simulator - in open-grid/hg conditions, viewer connectivity to | ||
102 | /// destination simulator is unknown. | ||
103 | /// </remarks> | ||
104 | private Stat m_interRegionTeleportFailures; | ||
105 | |||
80 | protected bool m_Enabled = false; | 106 | protected bool m_Enabled = false; |
81 | 107 | ||
82 | public Scene Scene { get; private set; } | 108 | public Scene Scene { get; private set; } |
@@ -156,6 +182,60 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
156 | 182 | ||
157 | Scene = scene; | 183 | Scene = scene; |
158 | 184 | ||
185 | m_interRegionTeleportAttempts = | ||
186 | new Stat( | ||
187 | "InterRegionTeleportAttempts", | ||
188 | "Number of inter-region teleports attempted.", | ||
189 | "This does not count attempts which failed due to pre-conditions (e.g. target simulator refused access).\n" | ||
190 | + "You can get successfully teleports by subtracting aborts, cancels and teleport failures from this figure.", | ||
191 | "", | ||
192 | "entitytransfer", | ||
193 | Scene.Name, | ||
194 | StatType.Push, | ||
195 | null, | ||
196 | StatVerbosity.Debug); | ||
197 | |||
198 | m_interRegionTeleportAborts = | ||
199 | new Stat( | ||
200 | "InterRegionTeleportAborts", | ||
201 | "Number of inter-region teleports aborted due to client actions.", | ||
202 | "The chief action is simultaneous logout whilst teleporting.", | ||
203 | "", | ||
204 | "entitytransfer", | ||
205 | Scene.Name, | ||
206 | StatType.Push, | ||
207 | null, | ||
208 | StatVerbosity.Debug); | ||
209 | |||
210 | m_interRegionTeleportCancels = | ||
211 | new Stat( | ||
212 | "InterRegionTeleportCancels", | ||
213 | "Number of inter-region teleports cancelled by the client.", | ||
214 | null, | ||
215 | "", | ||
216 | "entitytransfer", | ||
217 | Scene.Name, | ||
218 | StatType.Push, | ||
219 | null, | ||
220 | StatVerbosity.Debug); | ||
221 | |||
222 | m_interRegionTeleportFailures = | ||
223 | new Stat( | ||
224 | "InterRegionTeleportFailures", | ||
225 | "Number of inter-region teleports that failed due to server/client/network issues.", | ||
226 | "This number may not be very helpful in open-grid/hg situations as the network connectivity/quality of destinations is uncontrollable.", | ||
227 | "", | ||
228 | "entitytransfer", | ||
229 | Scene.Name, | ||
230 | StatType.Push, | ||
231 | null, | ||
232 | StatVerbosity.Debug); | ||
233 | |||
234 | StatsManager.RegisterStat(m_interRegionTeleportAttempts); | ||
235 | StatsManager.RegisterStat(m_interRegionTeleportAborts); | ||
236 | StatsManager.RegisterStat(m_interRegionTeleportCancels); | ||
237 | StatsManager.RegisterStat(m_interRegionTeleportFailures); | ||
238 | |||
159 | scene.RegisterModuleInterface<IEntityTransferModule>(this); | 239 | scene.RegisterModuleInterface<IEntityTransferModule>(this); |
160 | scene.EventManager.OnNewClient += OnNewClient; | 240 | scene.EventManager.OnNewClient += OnNewClient; |
161 | } | 241 | } |
@@ -173,7 +253,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
173 | 253 | ||
174 | public virtual void Close() {} | 254 | public virtual void Close() {} |
175 | 255 | ||
176 | public virtual void RemoveRegion(Scene scene) {} | 256 | public virtual void RemoveRegion(Scene scene) |
257 | { | ||
258 | StatsManager.DeregisterStat(m_interRegionTeleportAttempts); | ||
259 | StatsManager.DeregisterStat(m_interRegionTeleportAborts); | ||
260 | StatsManager.DeregisterStat(m_interRegionTeleportCancels); | ||
261 | StatsManager.DeregisterStat(m_interRegionTeleportFailures); | ||
262 | } | ||
177 | 263 | ||
178 | public virtual void RegionLoaded(Scene scene) | 264 | public virtual void RegionLoaded(Scene scene) |
179 | { | 265 | { |
@@ -545,6 +631,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
545 | return; | 631 | return; |
546 | } | 632 | } |
547 | 633 | ||
634 | // Before this point, teleport 'failure' is due to checkable pre-conditions such as whether the target | ||
635 | // simulator can be found and is explicitly prepared to allow access. Therefore, we will not count these | ||
636 | // as server attempts. | ||
637 | m_interRegionTeleportAttempts.Value++; | ||
638 | |||
548 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version); | 639 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version); |
549 | 640 | ||
550 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 641 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
@@ -595,6 +686,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
595 | bool logout = false; | 686 | bool logout = false; |
596 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 687 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) |
597 | { | 688 | { |
689 | m_interRegionTeleportFailures.Value++; | ||
690 | |||
598 | sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason)); | 691 | sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}", reason)); |
599 | 692 | ||
600 | m_log.DebugFormat( | 693 | m_log.DebugFormat( |
@@ -606,6 +699,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
606 | 699 | ||
607 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | 700 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) |
608 | { | 701 | { |
702 | m_interRegionTeleportCancels.Value++; | ||
703 | |||
609 | m_log.DebugFormat( | 704 | m_log.DebugFormat( |
610 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", | 705 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", |
611 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 706 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -614,6 +709,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
614 | } | 709 | } |
615 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 710 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
616 | { | 711 | { |
712 | m_interRegionTeleportAborts.Value++; | ||
713 | |||
617 | m_log.DebugFormat( | 714 | m_log.DebugFormat( |
618 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", | 715 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", |
619 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 716 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -683,6 +780,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
683 | // establish th econnection to the destination which makes it return true. | 780 | // establish th econnection to the destination which makes it return true. |
684 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 781 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
685 | { | 782 | { |
783 | m_interRegionTeleportAborts.Value++; | ||
784 | |||
686 | m_log.DebugFormat( | 785 | m_log.DebugFormat( |
687 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} before UpdateAgent", | 786 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} before UpdateAgent", |
688 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 787 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -698,6 +797,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
698 | { | 797 | { |
699 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 798 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
700 | { | 799 | { |
800 | m_interRegionTeleportAborts.Value++; | ||
801 | |||
701 | m_log.DebugFormat( | 802 | m_log.DebugFormat( |
702 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after UpdateAgent due to previous client close.", | 803 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after UpdateAgent due to previous client close.", |
703 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 804 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -715,6 +816,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
715 | 816 | ||
716 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | 817 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) |
717 | { | 818 | { |
819 | m_interRegionTeleportCancels.Value++; | ||
820 | |||
718 | m_log.DebugFormat( | 821 | m_log.DebugFormat( |
719 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after UpdateAgent on client request", | 822 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after UpdateAgent on client request", |
720 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 823 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -750,6 +853,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
750 | { | 853 | { |
751 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 854 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
752 | { | 855 | { |
856 | m_interRegionTeleportAborts.Value++; | ||
857 | |||
753 | m_log.DebugFormat( | 858 | m_log.DebugFormat( |
754 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", | 859 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", |
755 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 860 | sp.Name, finalDestination.RegionName, sp.Scene.Name); |
@@ -762,6 +867,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
762 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 867 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
763 | 868 | ||
764 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); | 869 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); |
870 | |||
765 | return; | 871 | return; |
766 | } | 872 | } |
767 | 873 | ||
@@ -803,15 +909,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
803 | // now we have a child agent in this region. | 909 | // now we have a child agent in this region. |
804 | sp.Reset(); | 910 | sp.Reset(); |
805 | } | 911 | } |
806 | |||
807 | // Commented pending deletion since this method no longer appears to do anything at all | ||
808 | // // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! | ||
809 | // if (sp.Scene.NeedSceneCacheClear(sp.UUID)) | ||
810 | // { | ||
811 | // m_log.DebugFormat( | ||
812 | // "[ENTITY TRANSFER MODULE]: User {0} is going to another region, profile cache removed", | ||
813 | // sp.UUID); | ||
814 | // } | ||
815 | } | 912 | } |
816 | 913 | ||
817 | /// <summary> | 914 | /// <summary> |
@@ -847,6 +944,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
847 | { | 944 | { |
848 | CleanupFailedInterRegionTeleport(sp, finalDestination); | 945 | CleanupFailedInterRegionTeleport(sp, finalDestination); |
849 | 946 | ||
947 | m_interRegionTeleportFailures.Value++; | ||
948 | |||
850 | sp.ControllingClient.SendTeleportFailed( | 949 | sp.ControllingClient.SendTeleportFailed( |
851 | string.Format( | 950 | string.Format( |
852 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); | 951 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); |