aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-06 19:52:54 +0000
committerJustin Clarke Casey2008-10-06 19:52:54 +0000
commitcb7a9eaa09fba301ba6b6838cb9e3cedfc29a32a (patch)
treef4f8c4f3b849f35e4a4e56d05740ad19651d4a71 /OpenSim/Framework
parentcleaning up OSHttpRequest removing old Http stuff. also adding test (diff)
downloadopensim-SC_OLD-cb7a9eaa09fba301ba6b6838cb9e3cedfc29a32a.zip
opensim-SC_OLD-cb7a9eaa09fba301ba6b6838cb9e3cedfc29a32a.tar.gz
opensim-SC_OLD-cb7a9eaa09fba301ba6b6838cb9e3cedfc29a32a.tar.bz2
opensim-SC_OLD-cb7a9eaa09fba301ba6b6838cb9e3cedfc29a32a.tar.xz
* Stop the sim stats reporter reusing the same SimStatsPacket for all clients
* I believe this was the cause of the remaining packet_out_of_order messages in the Linden client logs * There were race conditions where multiple clientstacks would overwrite each other's sequence numbers
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/IClientAPI.cs8
-rw-r--r--OpenSim/Framework/SimStats.cs88
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs48
3 files changed, 119 insertions, 25 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1a6a5a4..4071e47 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -722,7 +722,13 @@ namespace OpenSim.Framework
722 void SendImagePart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec); 722 void SendImagePart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec);
723 723
724 void SendShutdownConnectionNotice(); 724 void SendShutdownConnectionNotice();
725 void SendSimStats(Packet pack); 725
726 /// <summary>
727 /// Send statistical information about the sim to the client.
728 /// </summary>
729 /// <param name="stats"></param>
730 void SendSimStats(SimStats stats);
731
726 void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, 732 void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID,
727 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, 733 uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask,
728 uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category, 734 uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category,
diff --git a/OpenSim/Framework/SimStats.cs b/OpenSim/Framework/SimStats.cs
new file mode 100644
index 0000000..c77d0d4
--- /dev/null
+++ b/OpenSim/Framework/SimStats.cs
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse.Packets;
29
30namespace OpenSim.Framework
31{
32 /// <summary>
33 /// Enapsulate statistics for a simulator/scene.
34 ///
35 /// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats
36 /// storage.
37 /// </summary>
38 public class SimStats
39 {
40 public uint RegionX
41 {
42 get { return m_regionX; }
43 }
44 private uint m_regionX;
45
46 public uint RegionY
47 {
48 get { return m_regionY; }
49 }
50 private uint m_regionY;
51
52 public SimStatsPacket.RegionBlock RegionBlock
53 {
54 get { return m_regionBlock; }
55 }
56 private SimStatsPacket.RegionBlock m_regionBlock;
57
58 public SimStatsPacket.StatBlock[] StatsBlock
59 {
60 get { return m_statsBlock; }
61 }
62 private SimStatsPacket.StatBlock[] m_statsBlock;
63
64 public uint RegionFlags
65 {
66 get { return m_regionFlags; }
67 }
68 private uint m_regionFlags;
69
70 public uint ObjectCapacity
71 {
72 get { return m_objectCapacity; }
73 }
74 private uint m_objectCapacity;
75
76 public SimStats(
77 uint regionX, uint regionY, uint regionFlags, uint objectCapacity,
78 SimStatsPacket.RegionBlock regionBlock, SimStatsPacket.StatBlock[] statsBlock)
79 {
80 m_regionX = regionX;
81 m_regionY = regionY;
82 m_regionFlags = regionFlags;
83 m_objectCapacity = objectCapacity;
84 m_regionBlock = regionBlock;
85 m_statsBlock = statsBlock;
86 }
87 }
88}
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index 2f6bb7e..48bed81 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -216,31 +216,31 @@ namespace OpenSim.Framework.Statistics
216 /// client purposes) sends information to listeners. 216 /// client purposes) sends information to listeners.
217 /// </summary> 217 /// </summary>
218 /// <param name="pack"></param> 218 /// <param name="pack"></param>
219 public void ReceiveClassicSimStatsPacket(SimStatsPacket statsPacket) 219 public void ReceiveClassicSimStatsPacket(SimStats stats)
220 { 220 {
221 // FIXME: Really shouldn't rely on the probably arbitrary order in which 221 // FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original
222 // stats are packed into the packet 222 // SimStatsPacket that was being used).
223 timeDilation = statsPacket.Stat[0].StatValue; 223 timeDilation = stats.StatsBlock[0].StatValue;
224 simFps = statsPacket.Stat[1].StatValue; 224 simFps = stats.StatsBlock[1].StatValue;
225 physicsFps = statsPacket.Stat[2].StatValue; 225 physicsFps = stats.StatsBlock[2].StatValue;
226 agentUpdates = statsPacket.Stat[3].StatValue; 226 agentUpdates = stats.StatsBlock[3].StatValue;
227 rootAgents = statsPacket.Stat[4].StatValue; 227 rootAgents = stats.StatsBlock[4].StatValue;
228 childAgents = statsPacket.Stat[5].StatValue; 228 childAgents = stats.StatsBlock[5].StatValue;
229 totalPrims = statsPacket.Stat[6].StatValue; 229 totalPrims = stats.StatsBlock[6].StatValue;
230 activePrims = statsPacket.Stat[7].StatValue; 230 activePrims = stats.StatsBlock[7].StatValue;
231 totalFrameTime = statsPacket.Stat[8].StatValue; 231 totalFrameTime = stats.StatsBlock[8].StatValue;
232 netFrameTime = statsPacket.Stat[9].StatValue; 232 netFrameTime = stats.StatsBlock[9].StatValue;
233 physicsFrameTime = statsPacket.Stat[10].StatValue; 233 physicsFrameTime = stats.StatsBlock[10].StatValue;
234 otherFrameTime = statsPacket.Stat[11].StatValue; 234 otherFrameTime = stats.StatsBlock[11].StatValue;
235 imageFrameTime = statsPacket.Stat[12].StatValue; 235 imageFrameTime = stats.StatsBlock[12].StatValue;
236 inPacketsPerSecond = statsPacket.Stat[13].StatValue; 236 inPacketsPerSecond = stats.StatsBlock[13].StatValue;
237 outPacketsPerSecond = statsPacket.Stat[14].StatValue; 237 outPacketsPerSecond = stats.StatsBlock[14].StatValue;
238 unackedBytes = statsPacket.Stat[15].StatValue; 238 unackedBytes = stats.StatsBlock[15].StatValue;
239 agentFrameTime = statsPacket.Stat[16].StatValue; 239 agentFrameTime = stats.StatsBlock[16].StatValue;
240 pendingDownloads = statsPacket.Stat[17].StatValue; 240 pendingDownloads = stats.StatsBlock[17].StatValue;
241 pendingUploads = statsPacket.Stat[18].StatValue; 241 pendingUploads = stats.StatsBlock[18].StatValue;
242 activeScripts = statsPacket.Stat[19].StatValue; 242 activeScripts = stats.StatsBlock[19].StatValue;
243 scriptLinesPerSecond = statsPacket.Stat[20].StatValue; 243 scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
244 } 244 }
245 245
246 /// <summary> 246 /// <summary>