aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-11 22:17:05 +0100
committerJustin Clark-Casey (justincc)2011-10-11 22:17:05 +0100
commitfe3594c5ea4fe36f862375f76d088f64d2dfb269 (patch)
treeaeb7371c1a9778a919226978440f284024c91f55 /OpenSim
parentmeaningless change to goose panda (diff)
downloadopensim-SC_OLD-fe3594c5ea4fe36f862375f76d088f64d2dfb269.zip
opensim-SC_OLD-fe3594c5ea4fe36f862375f76d088f64d2dfb269.tar.gz
opensim-SC_OLD-fe3594c5ea4fe36f862375f76d088f64d2dfb269.tar.bz2
opensim-SC_OLD-fe3594c5ea4fe36f862375f76d088f64d2dfb269.tar.xz
Start recording object updates per second statistic (analogue of agent updates per secod) and expose via monitoring module as ObjectUpdatePerSecondMonitor
A useful diagnostic to find out how object updates are burdening a scene
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs28
3 files changed, 43 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
index 64997af..a75d94a 100644
--- a/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Monitoring/MonitorModule.cs
@@ -203,6 +203,14 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
203 m_monitors.Add( 203 m_monitors.Add(
204 new GenericMonitor( 204 new GenericMonitor(
205 m_scene, 205 m_scene,
206 "ObjectUpdatesPerSecondMonitor",
207 "Object Updates",
208 m => m.Scene.StatsReporter.LastReportedObjectUpdates,
209 m => string.Format("{0} per second", m.GetValue())));
210
211 m_monitors.Add(
212 new GenericMonitor(
213 m_scene,
206 "ActiveObjectCountMonitor", 214 "ActiveObjectCountMonitor",
207 "Active Objects", 215 "Active Objects",
208 m => m.Scene.StatsReporter.LastReportedSimStats[7], 216 m => m.Scene.StatsReporter.LastReportedSimStats[7],
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 6fa82b8..4abece1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3018,6 +3018,7 @@ namespace OpenSim.Region.Framework.Scenes
3018 //isattachment = ParentGroup.RootPart.IsAttachment; 3018 //isattachment = ParentGroup.RootPart.IsAttachment;
3019 3019
3020 remoteClient.SendPrimUpdate(this, PrimUpdateFlags.FullUpdate); 3020 remoteClient.SendPrimUpdate(this, PrimUpdateFlags.FullUpdate);
3021 ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
3021 } 3022 }
3022 3023
3023 /// <summary> 3024 /// <summary>
@@ -4792,7 +4793,12 @@ namespace OpenSim.Region.Framework.Scenes
4792 4793
4793 // Causes this thread to dig into the Client Thread Data. 4794 // Causes this thread to dig into the Client Thread Data.
4794 // Remember your locking here! 4795 // Remember your locking here!
4795 remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); 4796 remoteClient.SendPrimUpdate(
4797 this,
4798 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
4799 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
4800
4801 ParentGroup.Scene.StatsReporter.AddObjectUpdates(1);
4796 } 4802 }
4797 4803
4798 public void AddScriptLPS(int count) 4804 public void AddScriptLPS(int count)
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 8e1c8f0..6efbaa1 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -86,6 +86,15 @@ namespace OpenSim.Region.Framework.Scenes
86 get { return lastReportedSimFPS; } 86 get { return lastReportedSimFPS; }
87 } 87 }
88 88
89 /// <summary>
90 /// Number of object updates performed in the last stats cycle
91 /// </summary>
92 /// <remarks>
93 /// This isn't sent out to the client but it is very useful data to detect whether viewers are being sent a
94 /// large number of object updates.
95 /// </remarks>
96 public float LastReportedObjectUpdates { get; private set; }
97
89 public float[] LastReportedSimStats 98 public float[] LastReportedSimStats
90 { 99 {
91 get { return lastReportedSimStats; } 100 get { return lastReportedSimStats; }
@@ -100,8 +109,17 @@ namespace OpenSim.Region.Framework.Scenes
100 private float lastReportedSimFPS = 0; 109 private float lastReportedSimFPS = 0;
101 private float[] lastReportedSimStats = new float[21]; 110 private float[] lastReportedSimStats = new float[21];
102 private float m_pfps = 0; 111 private float m_pfps = 0;
112
113 /// <summary>
114 /// Number of agent updates requested in this stats cycle
115 /// </summary>
103 private int m_agentUpdates = 0; 116 private int m_agentUpdates = 0;
104 117
118 /// <summary>
119 /// Number of object updates requested in this stats cycle
120 /// </summary>
121 private int m_objectUpdates;
122
105 private int m_frameMS = 0; 123 private int m_frameMS = 0;
106 private int m_netMS = 0; 124 private int m_netMS = 0;
107 private int m_agentMS = 0; 125 private int m_agentMS = 0;
@@ -291,6 +309,10 @@ namespace OpenSim.Region.Framework.Scenes
291 { 309 {
292 handlerSendStatResult(simStats); 310 handlerSendStatResult(simStats);
293 } 311 }
312
313 // Extra statistics that aren't currently sent to clients
314 LastReportedObjectUpdates = m_objectUpdates / statsUpdateFactor;
315
294 resetvalues(); 316 resetvalues();
295 } 317 }
296 } 318 }
@@ -301,6 +323,7 @@ namespace OpenSim.Region.Framework.Scenes
301 m_fps = 0; 323 m_fps = 0;
302 m_pfps = 0; 324 m_pfps = 0;
303 m_agentUpdates = 0; 325 m_agentUpdates = 0;
326 m_objectUpdates = 0;
304 //m_inPacketsPerSecond = 0; 327 //m_inPacketsPerSecond = 0;
305 //m_outPacketsPerSecond = 0; 328 //m_outPacketsPerSecond = 0;
306 m_unAckedBytes = 0; 329 m_unAckedBytes = 0;
@@ -382,6 +405,11 @@ namespace OpenSim.Region.Framework.Scenes
382 m_pfps += frames; 405 m_pfps += frames;
383 } 406 }
384 407
408 public void AddObjectUpdates(int numUpdates)
409 {
410 m_objectUpdates += numUpdates;
411 }
412
385 public void AddAgentUpdates(int numUpdates) 413 public void AddAgentUpdates(int numUpdates)
386 { 414 {
387 m_agentUpdates += numUpdates; 415 m_agentUpdates += numUpdates;