aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-01-16 05:48:40 +0000
committerTeravus Ovares2008-01-16 05:48:40 +0000
commit5dd741267eae5c7dfcd20372ba1b43904dd4503a (patch)
tree15bc97bf2552a6fb45aec9eea401aa9a80190efc
parent* Added Packets In/s, Packets Out/s and Current un_acked Packets to the SimSt... (diff)
downloadopensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.zip
opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.gz
opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.bz2
opensim-SC_OLD-5dd741267eae5c7dfcd20372ba1b43904dd4503a.tar.xz
* Added Agent Time, Pending Downloads, and made Agent Updates/Sec actually accurate.
* We're only missing, the script related sim stats counters and the Images time counter and the Pending Uploads counter. The rest of them are actually implemented now.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/TextureDownloadModule.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs44
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs41
4 files changed, 93 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
index 6ebf47f..98a3287 100644
--- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs
@@ -137,7 +137,9 @@ namespace OpenSim.Region.Environment.Modules
137 if (TryGetUserTextureService(client.AgentId, out textureService)) 137 if (TryGetUserTextureService(client.AgentId, out textureService))
138 { 138 {
139 textureService.HandleTextureRequest(client, e); 139 textureService.HandleTextureRequest(client, e);
140 m_scene.AddPendingDownloads(1);
140 } 141 }
142
141 } 143 }
142 144
143 public void ProcessTextureSenders() 145 public void ProcessTextureSenders()
@@ -169,6 +171,7 @@ namespace OpenSim.Region.Environment.Modules
169 private void TextureSent(TextureSender sender) 171 private void TextureSent(TextureSender sender)
170 { 172 {
171 sender.Sending = false; 173 sender.Sending = false;
174 m_scene.AddPendingDownloads(-1);
172 } 175 }
173 } 176 }
174} \ No newline at end of file 177} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 16055de..f1a1843 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -607,7 +607,6 @@ namespace OpenSim.Region.Environment.Scenes
607 m_statsReporter.AddPhysicsFPS(physicsFPS); 607 m_statsReporter.AddPhysicsFPS(physicsFPS);
608 m_statsReporter.SetTimeDilation(m_timedilation); 608 m_statsReporter.SetTimeDilation(m_timedilation);
609 m_statsReporter.AddFPS(1); 609 m_statsReporter.AddFPS(1);
610 m_statsReporter.AddAgentUpdates(1);
611 m_statsReporter.AddInPackets(0); 610 m_statsReporter.AddInPackets(0);
612 m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount()); 611 m_statsReporter.SetRootAgents(m_innerScene.GetRootAgentCount());
613 m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); 612 m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount());
@@ -1766,6 +1765,20 @@ namespace OpenSim.Region.Environment.Scenes
1766 m_statsReporter.AddOutPackets(outPackets); 1765 m_statsReporter.AddOutPackets(outPackets);
1767 m_statsReporter.AddunAckedBytes(unAckedBytes); 1766 m_statsReporter.AddunAckedBytes(unAckedBytes);
1768 } 1767 }
1768 public void AddAgentTime(int ms)
1769 {
1770 m_statsReporter.addFrameMS(ms);
1771 m_statsReporter.addAgentMS(ms);
1772 }
1773 public void AddAgentUpdates(int count)
1774 {
1775 m_statsReporter.AddAgentUpdates(count);
1776 }
1777
1778 public void AddPendingDownloads(int count)
1779 {
1780 m_statsReporter.addPendingDownload(count);
1781 }
1769 1782
1770 #endregion 1783 #endregion
1771 1784
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 2e2bb62..30ad4a5 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -56,6 +56,8 @@ namespace OpenSim.Region.Environment.Scenes
56 private float m_sitAvatarHeight = 2.0f; 56 private float m_sitAvatarHeight = 2.0f;
57 private float m_godlevel = 0; 57 private float m_godlevel = 0;
58 58
59 private int m_perfMonMS = 0;
60
59 private bool m_setAlwaysRun = false; 61 private bool m_setAlwaysRun = false;
60 62
61 private Quaternion m_bodyRot; 63 private Quaternion m_bodyRot;
@@ -402,12 +404,16 @@ namespace OpenSim.Region.Environment.Scenes
402 // this.UpdateQuadTreeNode(); 404 // this.UpdateQuadTreeNode();
403 //this.RefreshQuadObject(); 405 //this.RefreshQuadObject();
404 //} 406 //}
407 m_perfMonMS = System.Environment.TickCount;
408
405 if (!m_gotAllObjectsInScene) 409 if (!m_gotAllObjectsInScene)
406 { 410 {
407 if (!m_isChildAgent || m_scene.m_sendTasksToChild) 411 if (!m_isChildAgent || m_scene.m_sendTasksToChild)
408 { 412 {
413
409 m_scene.SendAllSceneObjectsToClient(this); 414 m_scene.SendAllSceneObjectsToClient(this);
410 m_gotAllObjectsInScene = true; 415 m_gotAllObjectsInScene = true;
416
411 } 417 }
412 } 418 }
413 if (m_partsUpdateQueue.Count > 0) 419 if (m_partsUpdateQueue.Count > 0)
@@ -464,6 +470,8 @@ namespace OpenSim.Region.Environment.Scenes
464 } 470 }
465 } 471 }
466 } 472 }
473
474 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
467 } 475 }
468 476
469 public void forceAvatarMovement(Vector3 position, Quaternion rotation) 477 public void forceAvatarMovement(Vector3 position, Quaternion rotation)
@@ -634,6 +642,8 @@ namespace OpenSim.Region.Environment.Scenes
634 // Must check for standing up even when PhysicsActor is null, 642 // Must check for standing up even when PhysicsActor is null,
635 // since sitting currently removes avatar from physical scene 643 // since sitting currently removes avatar from physical scene
636 644
645 m_perfMonMS = System.Environment.TickCount;
646
637 uint flags = agentData.AgentData.ControlFlags; 647 uint flags = agentData.AgentData.ControlFlags;
638 LLQuaternion bodyRotation = agentData.AgentData.BodyRotation; 648 LLQuaternion bodyRotation = agentData.AgentData.BodyRotation;
639 649
@@ -760,8 +770,10 @@ namespace OpenSim.Region.Environment.Scenes
760 UpdateMovementAnimations(update_movementflag); 770 UpdateMovementAnimations(update_movementflag);
761 } 771 }
762 } 772 }
763 773
764 m_scene.EventManager.TriggerOnClientMovement(this); 774 m_scene.EventManager.TriggerOnClientMovement(this);
775
776 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
765 } 777 }
766 778
767 /// <summary> 779 /// <summary>
@@ -1008,6 +1020,8 @@ namespace OpenSim.Region.Environment.Scenes
1008 /// </summary> 1020 /// </summary>
1009 protected void UpdateMovementAnimations(bool update_movementflag) 1021 protected void UpdateMovementAnimations(bool update_movementflag)
1010 { 1022 {
1023
1024
1011 if (update_movementflag) 1025 if (update_movementflag)
1012 { 1026 {
1013 // Are we moving? 1027 // Are we moving?
@@ -1081,6 +1095,7 @@ namespace OpenSim.Region.Environment.Scenes
1081 } 1095 }
1082 } 1096 }
1083 } 1097 }
1098
1084 } 1099 }
1085 1100
1086 /// <summary> 1101 /// <summary>
@@ -1093,6 +1108,9 @@ namespace OpenSim.Region.Environment.Scenes
1093 Console.WriteLine("DEBUG: AddNewMovement: child agent"); 1108 Console.WriteLine("DEBUG: AddNewMovement: child agent");
1094 return; 1109 return;
1095 } 1110 }
1111
1112 m_perfMonMS = System.Environment.TickCount;
1113
1096 m_rotation = rotation; 1114 m_rotation = rotation;
1097 NewForce newVelocity = new NewForce(); 1115 NewForce newVelocity = new NewForce();
1098 Vector3 direc = rotation*vec; 1116 Vector3 direc = rotation*vec;
@@ -1134,6 +1152,8 @@ namespace OpenSim.Region.Environment.Scenes
1134 newVelocity.Y = direc.y; 1152 newVelocity.Y = direc.y;
1135 newVelocity.Z = direc.z; 1153 newVelocity.Z = direc.z;
1136 m_forcesList.Add(newVelocity); 1154 m_forcesList.Add(newVelocity);
1155
1156 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1137 } 1157 }
1138 1158
1139 #endregion 1159 #endregion
@@ -1190,11 +1210,16 @@ namespace OpenSim.Region.Environment.Scenes
1190 /// <param name="remoteClient"></param> 1210 /// <param name="remoteClient"></param>
1191 public void SendTerseUpdateToClient(IClientAPI remoteClient) 1211 public void SendTerseUpdateToClient(IClientAPI remoteClient)
1192 { 1212 {
1213 m_perfMonMS = System.Environment.TickCount;
1214
1193 LLVector3 pos = m_pos; 1215 LLVector3 pos = m_pos;
1194 LLVector3 vel = Velocity; 1216 LLVector3 vel = Velocity;
1195 LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w); 1217 LLQuaternion rot = new LLQuaternion(m_bodyRot.x, m_bodyRot.y, m_bodyRot.z, m_bodyRot.w);
1196 remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z), 1218 remoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z),
1197 new LLVector3(vel.X, vel.Y, vel.Z), rot); 1219 new LLVector3(vel.X, vel.Y, vel.Z), rot);
1220
1221 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1222 m_scene.AddAgentUpdates(1);
1198 } 1223 }
1199 1224
1200 /// <summary> 1225 /// <summary>
@@ -1202,11 +1227,18 @@ namespace OpenSim.Region.Environment.Scenes
1202 /// </summary> 1227 /// </summary>
1203 public void SendTerseUpdateToAllClients() 1228 public void SendTerseUpdateToAllClients()
1204 { 1229 {
1230 m_perfMonMS = System.Environment.TickCount;
1231
1205 m_scene.Broadcast(SendTerseUpdateToClient); 1232 m_scene.Broadcast(SendTerseUpdateToClient);
1233
1234 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1235
1206 } 1236 }
1207 1237
1208 public void SendCoarseLocations() 1238 public void SendCoarseLocations()
1209 { 1239 {
1240 m_perfMonMS = System.Environment.TickCount;
1241
1210 List<LLVector3> CoarseLocations = new List<LLVector3>(); 1242 List<LLVector3> CoarseLocations = new List<LLVector3>();
1211 List<ScenePresence> avatars = m_scene.GetAvatars(); 1243 List<ScenePresence> avatars = m_scene.GetAvatars();
1212 for (int i = 0; i < avatars.Count; i++) 1244 for (int i = 0; i < avatars.Count; i++)
@@ -1218,6 +1250,8 @@ namespace OpenSim.Region.Environment.Scenes
1218 } 1250 }
1219 1251
1220 m_controllingClient.SendCoarseLocationUpdate(CoarseLocations); 1252 m_controllingClient.SendCoarseLocationUpdate(CoarseLocations);
1253
1254 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1221 } 1255 }
1222 1256
1223 public void CoarseLocationChange() 1257 public void CoarseLocationChange()
@@ -1234,6 +1268,7 @@ namespace OpenSim.Region.Environment.Scenes
1234 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, 1268 remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
1235 LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), 1269 LocalId, m_pos, m_appearance.TextureEntry.ToBytes(),
1236 m_parentID); 1270 m_parentID);
1271 m_scene.AddAgentUpdates(1);
1237 } 1272 }
1238 1273
1239 /// <summary> 1274 /// <summary>
@@ -1241,6 +1276,8 @@ namespace OpenSim.Region.Environment.Scenes
1241 /// </summary> 1276 /// </summary>
1242 public void SendFullUpdateToAllClients() 1277 public void SendFullUpdateToAllClients()
1243 { 1278 {
1279 m_perfMonMS = System.Environment.TickCount;
1280
1244 List<ScenePresence> avatars = m_scene.GetScenePresences(); 1281 List<ScenePresence> avatars = m_scene.GetScenePresences();
1245 foreach (ScenePresence avatar in avatars) 1282 foreach (ScenePresence avatar in avatars)
1246 { 1283 {
@@ -1254,6 +1291,8 @@ namespace OpenSim.Region.Environment.Scenes
1254 } 1291 }
1255 } 1292 }
1256 } 1293 }
1294 m_scene.AddAgentUpdates(avatars.Count);
1295 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1257 } 1296 }
1258 1297
1259 /// <summary> 1298 /// <summary>
@@ -1289,6 +1328,8 @@ namespace OpenSim.Region.Environment.Scenes
1289 /// </summary> 1328 /// </summary>
1290 public void SendAppearanceToAllOtherAgents() 1329 public void SendAppearanceToAllOtherAgents()
1291 { 1330 {
1331 m_perfMonMS=System.Environment.TickCount;
1332
1292 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 1333 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
1293 { 1334 {
1294 if (scenePresence.UUID != UUID) 1335 if (scenePresence.UUID != UUID)
@@ -1296,6 +1337,7 @@ namespace OpenSim.Region.Environment.Scenes
1296 m_appearance.SendAppearanceToOtherAgent(scenePresence); 1337 m_appearance.SendAppearanceToOtherAgent(scenePresence);
1297 } 1338 }
1298 }); 1339 });
1340 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1299 } 1341 }
1300 1342
1301 public void SendAppearanceToOtherAgent(ScenePresence avatar) 1343 public void SendAppearanceToOtherAgent(ScenePresence avatar)
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 36c2868..38e3218 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -57,6 +57,8 @@ namespace OpenSim.Region.Environment.Scenes
57 ChildAgents = 14, 57 ChildAgents = 14,
58 InPacketsPerSecond = 17, 58 InPacketsPerSecond = 17,
59 OutPacketsPerSecond = 18, 59 OutPacketsPerSecond = 18,
60 PendingDownloads = 19,
61 PendingUploads = 20,
60 UnAckedBytes = 24 62 UnAckedBytes = 24
61 } 63 }
62 64
@@ -64,9 +66,10 @@ namespace OpenSim.Region.Environment.Scenes
64 private float m_timeDilation = 0; 66 private float m_timeDilation = 0;
65 private int m_fps = 0; 67 private int m_fps = 0;
66 private float m_pfps = 0; 68 private float m_pfps = 0;
67 private float m_agentUpdates = 0; 69 private int m_agentUpdates = 0;
68 private int m_frameMS = 0; 70 private int m_frameMS = 0;
69 private int m_netMS = 0; 71 private int m_netMS = 0;
72 private int m_agentMS = 0;
70 private int m_physicsMS = 0; 73 private int m_physicsMS = 0;
71 private int m_imageMS = 0; 74 private int m_imageMS = 0;
72 private int m_otherMS = 0; 75 private int m_otherMS = 0;
@@ -77,8 +80,11 @@ namespace OpenSim.Region.Environment.Scenes
77 private int m_outPacketsPerSecond = 0; 80 private int m_outPacketsPerSecond = 0;
78 private int m_activePrim = 0; 81 private int m_activePrim = 0;
79 private int m_unAckedBytes = 0; 82 private int m_unAckedBytes = 0;
83 private int m_pendingDownloads = 0;
84 private int m_pendingUploads = 0;
85
80 86
81 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[16]; 87 SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[19];
82 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); 88 SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
83 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats); 89 SimStatsPacket statpack = (SimStatsPacket)PacketPool.Instance.GetPacket(PacketType.SimStats);
84 90
@@ -91,7 +97,7 @@ namespace OpenSim.Region.Environment.Scenes
91 public SimStatsReporter(RegionInfo regionData) 97 public SimStatsReporter(RegionInfo regionData)
92 { 98 {
93 ReportingRegion = regionData; 99 ReportingRegion = regionData;
94 for (int i = 0; i<16;i++) 100 for (int i = 0; i<19;i++)
95 { 101 {
96 sb[i] = new SimStatsPacket.StatBlock(); 102 sb[i] = new SimStatsPacket.StatBlock();
97 } 103 }
@@ -157,7 +163,7 @@ namespace OpenSim.Region.Environment.Scenes
157 sb[3].StatValue = (m_agentUpdates); 163 sb[3].StatValue = (m_agentUpdates);
158 164
159 //sb[4] = sbb; 165 //sb[4] = sbb;
160 //sb[4].StatID = (uint) Stats.Agents; 166 sb[4].StatID = (uint) Stats.Agents;
161 sb[4].StatValue = m_rootAgents; 167 sb[4].StatValue = m_rootAgents;
162 168
163 //sb[5] = sbb; 169 //sb[5] = sbb;
@@ -188,17 +194,26 @@ namespace OpenSim.Region.Environment.Scenes
188 sb[12].StatValue = m_otherMS; 194 sb[12].StatValue = m_otherMS;
189 195
190 //sb[8] = sbb; 196 //sb[8] = sbb;
191 sb[13].StatID = (uint) Stats.InPacketsPerSecond; 197 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
192 sb[13].StatValue = (m_inPacketsPerSecond); 198 sb[13].StatValue = (m_inPacketsPerSecond);
193 199
194 //sb[9] = sbb; 200 //sb[9] = sbb;
195 sb[14].StatID = (uint) Stats.OutPacketsPerSecond; 201 sb[14].StatID = (uint)Stats.OutPacketsPerSecond;
196 sb[14].StatValue = (m_outPacketsPerSecond); 202 sb[14].StatValue = (m_outPacketsPerSecond);
197 203
198 //sb[10] = sbb; 204 //sb[10] = sbb;
199 sb[15].StatID = (uint) Stats.UnAckedBytes; 205 sb[15].StatID = (uint)Stats.UnAckedBytes;
200 sb[15].StatValue = m_unAckedBytes; 206 sb[15].StatValue = m_unAckedBytes;
201 207
208 sb[16].StatID = (uint)Stats.AgentMS;
209 sb[16].StatValue = m_agentMS;
210
211 sb[17].StatID = (uint)Stats.PendingDownloads;
212 sb[17].StatValue = m_pendingDownloads;
213
214 sb[18].StatID = (uint)Stats.PendingUploads;
215 sb[18].StatValue = m_pendingUploads;
216
202 statpack.Stat = sb; 217 statpack.Stat = sb;
203 218
204 if (OnSendStatsResult != null) 219 if (OnSendStatsResult != null)
@@ -218,6 +233,7 @@ namespace OpenSim.Region.Environment.Scenes
218 m_outPacketsPerSecond = 0; 233 m_outPacketsPerSecond = 0;
219 m_unAckedBytes = 0; 234 m_unAckedBytes = 0;
220 m_frameMS = 0; 235 m_frameMS = 0;
236 m_agentMS = 0;
221 m_netMS = 0; 237 m_netMS = 0;
222 m_physicsMS = 0; 238 m_physicsMS = 0;
223 m_imageMS = 0; 239 m_imageMS = 0;
@@ -266,7 +282,7 @@ namespace OpenSim.Region.Environment.Scenes
266 m_pfps += frames; 282 m_pfps += frames;
267 } 283 }
268 284
269 public void AddAgentUpdates(float numUpdates) 285 public void AddAgentUpdates(int numUpdates)
270 { 286 {
271 m_agentUpdates += numUpdates; 287 m_agentUpdates += numUpdates;
272 } 288 }
@@ -294,6 +310,10 @@ namespace OpenSim.Region.Environment.Scenes
294 { 310 {
295 m_netMS += ms; 311 m_netMS += ms;
296 } 312 }
313 public void addAgentMS(int ms)
314 {
315 m_agentMS += ms;
316 }
297 public void addPhysicsMS(int ms) 317 public void addPhysicsMS(int ms)
298 { 318 {
299 m_physicsMS += ms; 319 m_physicsMS += ms;
@@ -306,5 +326,10 @@ namespace OpenSim.Region.Environment.Scenes
306 { 326 {
307 m_otherMS += ms; 327 m_otherMS += ms;
308 } 328 }
329 public void addPendingDownload(int count)
330 {
331 m_pendingDownloads += count;
332 }
333
309 } 334 }
310} 335}