diff options
author | Teravus Ovares | 2008-12-21 00:11:54 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-12-21 00:11:54 +0000 |
commit | 119104e35bc02e15a1ce08175ca6408fb8e9f7be (patch) | |
tree | 1f206e4380b559b856f7d03da79b3aff9f5b9712 /OpenSim | |
parent | Slowing things down even more on TPs, to see if that helps the European folks... (diff) | |
download | opensim-SC-119104e35bc02e15a1ce08175ca6408fb8e9f7be.zip opensim-SC-119104e35bc02e15a1ce08175ca6408fb8e9f7be.tar.gz opensim-SC-119104e35bc02e15a1ce08175ca6408fb8e9f7be.tar.bz2 opensim-SC-119104e35bc02e15a1ce08175ca6408fb8e9f7be.tar.xz |
* Re-implement packet tracking in IClientAPI so we can see what's going on in the client network in the simstats manager. This makes packets in per second, packets out per second, and unacked bytes work again in the simulator stats section.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 1 | ||||
-rw-r--r-- | OpenSim/Tests/Common/Mock/TestClient.cs | 1 |
7 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index a9c05f6..e3163d7 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -47,9 +47,6 @@ namespace OpenSim.Framework | |||
47 | 47 | ||
48 | public delegate void ImprovedInstantMessage(IClientAPI remoteclient, GridInstantMessage im); | 48 | public delegate void ImprovedInstantMessage(IClientAPI remoteclient, GridInstantMessage im); |
49 | 49 | ||
50 | // This shouldn't be cut down... | ||
51 | // especially if we're ever going to implement groups, presence, estate message dialogs... | ||
52 | |||
53 | public delegate void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, | 50 | public delegate void RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, |
54 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 51 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
55 | bool RezSelected, bool RemoveItem, UUID fromTaskID); | 52 | bool RezSelected, bool RemoveItem, UUID fromTaskID); |
@@ -63,6 +60,8 @@ namespace OpenSim.Framework | |||
63 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, | 60 | float height, float seconds, byte size, byte action, float north, float west, float south, float east, |
64 | UUID agentId); | 61 | UUID agentId); |
65 | 62 | ||
63 | public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes); | ||
64 | |||
66 | public delegate void SetAppearance(byte[] texture, List<byte> visualParamList); | 65 | public delegate void SetAppearance(byte[] texture, List<byte> visualParamList); |
67 | 66 | ||
68 | public delegate void StartAnim(IClientAPI remoteClient, UUID animID); | 67 | public delegate void StartAnim(IClientAPI remoteClient, UUID animID); |
@@ -722,6 +721,7 @@ namespace OpenSim.Framework | |||
722 | 721 | ||
723 | event StartLure OnStartLure; | 722 | event StartLure OnStartLure; |
724 | event TeleportLureRequest OnTeleportLureRequest; | 723 | event TeleportLureRequest OnTeleportLureRequest; |
724 | event NetworkStats OnNetworkStatsUpdate; | ||
725 | 725 | ||
726 | // void ActivateGesture(UUID assetId, UUID gestureId); | 726 | // void ActivateGesture(UUID assetId, UUID gestureId); |
727 | 727 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5ce5235..9d8ecf0 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -272,6 +272,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
272 | private StartLure handlerStartLure; | 272 | private StartLure handlerStartLure; |
273 | private TeleportLureRequest handlerTeleportLureRequest; | 273 | private TeleportLureRequest handlerTeleportLureRequest; |
274 | 274 | ||
275 | private NetworkStats handlerNetworkStatsUpdate; | ||
276 | |||
275 | private readonly IGroupsModule m_GroupsModule; | 277 | private readonly IGroupsModule m_GroupsModule; |
276 | 278 | ||
277 | //private TerrainUnacked handlerUnackedTerrain = null; | 279 | //private TerrainUnacked handlerUnackedTerrain = null; |
@@ -450,7 +452,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
450 | 452 | ||
451 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); | 453 | m_PacketHandler = new LLPacketHandler(this, m_networkServer, userSettings); |
452 | m_PacketHandler.SynchronizeClient = SynchronizeClient; | 454 | m_PacketHandler.SynchronizeClient = SynchronizeClient; |
453 | 455 | m_PacketHandler.OnPacketStats += PopulateStats; | |
456 | |||
454 | RegisterLocalPacketHandlers(); | 457 | RegisterLocalPacketHandlers(); |
455 | 458 | ||
456 | m_clientThread = new Thread(Start); | 459 | m_clientThread = new Thread(Start); |
@@ -572,6 +575,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
572 | 575 | ||
573 | public void Terminate() | 576 | public void Terminate() |
574 | { | 577 | { |
578 | m_PacketHandler.OnPacketStats -= PopulateStats; | ||
575 | m_PacketHandler.Stop(); | 579 | m_PacketHandler.Stop(); |
576 | 580 | ||
577 | // wait for thread stoped | 581 | // wait for thread stoped |
@@ -585,6 +589,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
585 | 589 | ||
586 | # region Packet Handling | 590 | # region Packet Handling |
587 | 591 | ||
592 | public void PopulateStats(int inPackets, int outPackets, int unAckedBytes) | ||
593 | { | ||
594 | handlerNetworkStatsUpdate = OnNetworkStatsUpdate; | ||
595 | if (handlerNetworkStatsUpdate != null) | ||
596 | { | ||
597 | handlerNetworkStatsUpdate(inPackets, outPackets, unAckedBytes); | ||
598 | } | ||
599 | } | ||
600 | |||
588 | public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) | 601 | public static bool AddPacketHandler(PacketType packetType, PacketMethod handler) |
589 | { | 602 | { |
590 | bool result = false; | 603 | bool result = false; |
@@ -1017,6 +1030,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1017 | 1030 | ||
1018 | public event StartLure OnStartLure; | 1031 | public event StartLure OnStartLure; |
1019 | public event TeleportLureRequest OnTeleportLureRequest; | 1032 | public event TeleportLureRequest OnTeleportLureRequest; |
1033 | public event NetworkStats OnNetworkStatsUpdate; | ||
1020 | 1034 | ||
1021 | 1035 | ||
1022 | public void ActivateGesture(UUID assetId, UUID gestureId) | 1036 | public void ActivateGesture(UUID assetId, UUID gestureId) |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 66662a0..6ca2bb4 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -344,6 +344,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
344 | 344 | ||
345 | public event StartLure OnStartLure; | 345 | public event StartLure OnStartLure; |
346 | public event TeleportLureRequest OnTeleportLureRequest; | 346 | public event TeleportLureRequest OnTeleportLureRequest; |
347 | public event NetworkStats OnNetworkStatsUpdate; | ||
347 | 348 | ||
348 | 349 | ||
349 | #pragma warning restore 67 | 350 | #pragma warning restore 67 |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2b8ee74..5bc416f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2346,6 +2346,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
2346 | client.OnSoundTrigger += soundModule.TriggerSound; | 2346 | client.OnSoundTrigger += soundModule.TriggerSound; |
2347 | 2347 | ||
2348 | client.OnObjectOwner += ObjectOwner; | 2348 | client.OnObjectOwner += ObjectOwner; |
2349 | |||
2350 | if (m_statsReporter != null) | ||
2351 | client.OnNetworkStatsUpdate += m_statsReporter.AddPacketsFromClientStats; | ||
2349 | 2352 | ||
2350 | // EventManager.TriggerOnNewClient(client); | 2353 | // EventManager.TriggerOnNewClient(client); |
2351 | } | 2354 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 70287fc..c614f78 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -409,6 +409,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
409 | return lastReportedSimFPS; | 409 | return lastReportedSimFPS; |
410 | } | 410 | } |
411 | 411 | ||
412 | public void AddPacketsFromClientStats(int inPackets, int outPackets, int unAckedBytes) | ||
413 | { | ||
414 | AddInPackets(inPackets); | ||
415 | AddOutPackets(outPackets); | ||
416 | AddunAckedBytes(unAckedBytes); | ||
417 | |||
418 | } | ||
419 | |||
412 | #endregion | 420 | #endregion |
413 | } | 421 | } |
414 | } | 422 | } |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 35b5233..4cd5187 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -239,6 +239,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
239 | 239 | ||
240 | public event StartLure OnStartLure; | 240 | public event StartLure OnStartLure; |
241 | public event TeleportLureRequest OnTeleportLureRequest; | 241 | public event TeleportLureRequest OnTeleportLureRequest; |
242 | public event NetworkStats OnNetworkStatsUpdate; | ||
242 | 243 | ||
243 | #pragma warning restore 67 | 244 | #pragma warning restore 67 |
244 | 245 | ||
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 1bcf829..70a2d11 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -235,6 +235,7 @@ namespace OpenSim.Tests.Common.Mock | |||
235 | 235 | ||
236 | public event StartLure OnStartLure; | 236 | public event StartLure OnStartLure; |
237 | public event TeleportLureRequest OnTeleportLureRequest; | 237 | public event TeleportLureRequest OnTeleportLureRequest; |
238 | public event NetworkStats OnNetworkStatsUpdate; | ||
238 | 239 | ||
239 | #pragma warning restore 67 | 240 | #pragma warning restore 67 |
240 | 241 | ||