aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-01 04:45:42 +0100
committerJustin Clark-Casey (justincc)2012-06-01 04:47:11 +0100
commit72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf (patch)
treec4046641409e21ce18452ef2d7c516f8517c7d1a /OpenSim
parentAdd optional total avatars, total prims and active prims stats to ODE plugin. (diff)
downloadopensim-SC-72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf.zip
opensim-SC-72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf.tar.gz
opensim-SC-72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf.tar.bz2
opensim-SC-72219eae7d3dac01e73ab5fdf84f05f8d0fa00cf.tar.xz
Instead of updating sim stats root agent, child, objects and scripts accounts every single scene frame, update in the once every 3 seconds SimStatsReporter run
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs42
2 files changed, 14 insertions, 33 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ce386be..702e322 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1462,10 +1462,6 @@ namespace OpenSim.Region.Framework.Scenes
1462 StatsReporter.AddPhysicsFPS(physicsFPS); 1462 StatsReporter.AddPhysicsFPS(physicsFPS);
1463 StatsReporter.AddTimeDilation(TimeDilation); 1463 StatsReporter.AddTimeDilation(TimeDilation);
1464 StatsReporter.AddFPS(1); 1464 StatsReporter.AddFPS(1);
1465 StatsReporter.SetRootAgents(m_sceneGraph.GetRootAgentCount());
1466 StatsReporter.SetChildAgents(m_sceneGraph.GetChildAgentCount());
1467 StatsReporter.SetObjects(m_sceneGraph.GetTotalObjectsCount());
1468 StatsReporter.SetActiveObjects(m_sceneGraph.GetActiveObjectsCount());
1469 1465
1470 // frameMS currently records work frame times, not total frame times (work + any required sleep to 1466 // frameMS currently records work frame times, not total frame times (work + any required sleep to
1471 // reach min frame time. 1467 // reach min frame time.
@@ -1474,7 +1470,6 @@ namespace OpenSim.Region.Framework.Scenes
1474 StatsReporter.addAgentMS(agentMS); 1470 StatsReporter.addAgentMS(agentMS);
1475 StatsReporter.addPhysicsMS(physicsMS + physicsMS2); 1471 StatsReporter.addPhysicsMS(physicsMS + physicsMS2);
1476 StatsReporter.addOtherMS(otherMS); 1472 StatsReporter.addOtherMS(otherMS);
1477 StatsReporter.SetActiveScripts(m_sceneGraph.GetActiveScriptsCount());
1478 StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); 1473 StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS());
1479 1474
1480 if (LoginsDisabled && Frame == 20) 1475 if (LoginsDisabled && Frame == 20)
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 08d8d7c..87af311 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -207,6 +207,10 @@ namespace OpenSim.Region.Framework.Scenes
207 m_report.Close(); 207 m_report.Close();
208 } 208 }
209 209
210 /// <summary>
211 /// Sets the number of milliseconds between stat updates.
212 /// </summary>
213 /// <param name='ms'></param>
210 public void SetUpdateMS(int ms) 214 public void SetUpdateMS(int ms)
211 { 215 {
212 statsUpdatesEveryMS = ms; 216 statsUpdatesEveryMS = ms;
@@ -254,6 +258,16 @@ namespace OpenSim.Region.Framework.Scenes
254 physfps = 0; 258 physfps = 0;
255 259
256#endregion 260#endregion
261
262 m_rootAgents = m_scene.SceneGraph.GetRootAgentCount();
263 m_childAgents = m_scene.SceneGraph.GetChildAgentCount();
264 m_numPrim = m_scene.SceneGraph.GetTotalObjectsCount();
265 m_activePrim = m_scene.SceneGraph.GetActiveObjectsCount();
266 m_activeScripts = m_scene.SceneGraph.GetActiveScriptsCount();
267
268 // FIXME: Checking for stat sanity is a complex approach. What we really need to do is fix the code
269 // so that stat numbers are always consistent.
270 CheckStatSanity();
257 271
258 //Our time dilation is 0.91 when we're running a full speed, 272 //Our time dilation is 0.91 when we're running a full speed,
259 // therefore to make sure we get an appropriate range, 273 // therefore to make sure we get an appropriate range,
@@ -408,13 +422,6 @@ namespace OpenSim.Region.Framework.Scenes
408 m_timeDilation = td; 422 m_timeDilation = td;
409 } 423 }
410 424
411 public void SetRootAgents(int rootAgents)
412 {
413 m_rootAgents = rootAgents;
414 CheckStatSanity();
415
416 }
417
418 internal void CheckStatSanity() 425 internal void CheckStatSanity()
419 { 426 {
420 if (m_rootAgents < 0 || m_childAgents < 0) 427 if (m_rootAgents < 0 || m_childAgents < 0)
@@ -431,22 +438,6 @@ namespace OpenSim.Region.Framework.Scenes
431 } 438 }
432 } 439 }
433 440
434 public void SetChildAgents(int childAgents)
435 {
436 m_childAgents = childAgents;
437 CheckStatSanity();
438 }
439
440 public void SetObjects(int objects)
441 {
442 m_numPrim = objects;
443 }
444
445 public void SetActiveObjects(int objects)
446 {
447 m_activePrim = objects;
448 }
449
450 public void AddFPS(int frames) 441 public void AddFPS(int frames)
451 { 442 {
452 m_fps += frames; 443 m_fps += frames;
@@ -528,11 +519,6 @@ namespace OpenSim.Region.Framework.Scenes
528 m_scriptLinesPerSecond += count; 519 m_scriptLinesPerSecond += count;
529 } 520 }
530 521
531 public void SetActiveScripts(int count)
532 {
533 m_activeScripts = count;
534 }
535
536 public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) 522 public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes)
537 { 523 {
538 AddInPackets(inPackets); 524 AddInPackets(inPackets);