aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 86f43b3..9af43f5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -125,6 +125,12 @@ namespace OpenSim.Region.Environment.Scenes
125 private int m_update_land = 1; 125 private int m_update_land = 1;
126 private int m_update_avatars = 1; 126 private int m_update_avatars = 1;
127 127
128 private int frameMS = 0;
129 private int physicsMS2 = 0;
130 private int physicsMS = 0;
131 private int otherMS = 0;
132
133
128 #endregion 134 #endregion
129 135
130 #region Properties 136 #region Properties
@@ -551,6 +557,8 @@ namespace OpenSim.Region.Environment.Scenes
551 // Aquire a lock so only one update call happens at once 557 // Aquire a lock so only one update call happens at once
552 updateLock.WaitOne(); 558 updateLock.WaitOne();
553 float physicsFPS = 0; 559 float physicsFPS = 0;
560
561 frameMS = System.Environment.TickCount;
554 try 562 try
555 { 563 {
556 // Increment the frame counter 564 // Increment the frame counter
@@ -559,18 +567,26 @@ namespace OpenSim.Region.Environment.Scenes
559 // Loop it 567 // Loop it
560 if (m_frame == Int32.MaxValue) 568 if (m_frame == Int32.MaxValue)
561 m_frame = 0; 569 m_frame = 0;
570
562 571
572 physicsMS2 = System.Environment.TickCount;
563 if (m_frame%m_update_physics == 0) 573 if (m_frame%m_update_physics == 0)
564 m_innerScene.UpdatePreparePhysics(); 574 m_innerScene.UpdatePreparePhysics();
575 physicsMS2 = System.Environment.TickCount - physicsMS2;
565 576
566 if (m_frame%m_update_entitymovement == 0) 577 if (m_frame%m_update_entitymovement == 0)
567 m_innerScene.UpdateEntityMovement(); 578 m_innerScene.UpdateEntityMovement();
568 579
580 physicsMS = System.Environment.TickCount;
569 if (m_frame%m_update_physics == 0) 581 if (m_frame%m_update_physics == 0)
570 physicsFPS = m_innerScene.UpdatePhysics( 582 physicsFPS = m_innerScene.UpdatePhysics(
571 Math.Max(SinceLastFrame.TotalSeconds, m_timespan) 583 Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
572 ); 584 );
585
586 physicsMS = System.Environment.TickCount - physicsMS;
587 physicsMS += physicsMS2;
573 588
589 otherMS = System.Environment.TickCount;
574 if (m_frame%m_update_entities == 0) 590 if (m_frame%m_update_entities == 0)
575 m_innerScene.UpdateEntities(); 591 m_innerScene.UpdateEntities();
576 592
@@ -585,7 +601,7 @@ namespace OpenSim.Region.Environment.Scenes
585 601
586 if (m_frame%m_update_land == 0) 602 if (m_frame%m_update_land == 0)
587 UpdateLand(); 603 UpdateLand();
588 604 otherMS = System.Environment.TickCount - otherMS;
589 // if (m_frame%m_update_avatars == 0) 605 // if (m_frame%m_update_avatars == 0)
590 // UpdateInWorldTime(); 606 // UpdateInWorldTime();
591 m_statsReporter.AddPhysicsFPS(physicsFPS); 607 m_statsReporter.AddPhysicsFPS(physicsFPS);
@@ -597,6 +613,11 @@ namespace OpenSim.Region.Environment.Scenes
597 m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount()); 613 m_statsReporter.SetChildAgents(m_innerScene.GetChildAgentCount());
598 m_statsReporter.SetObjects(m_innerScene.GetTotalObjects()); 614 m_statsReporter.SetObjects(m_innerScene.GetTotalObjects());
599 m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects()); 615 m_statsReporter.SetActiveObjects(m_innerScene.GetActiveObjects());
616 frameMS = System.Environment.TickCount - frameMS;
617 m_statsReporter.addFrameMS(frameMS);
618 m_statsReporter.addPhysicsMS(physicsMS);
619 m_statsReporter.addOtherMS(otherMS);
620
600 } 621 }
601 catch (NotImplementedException) 622 catch (NotImplementedException)
602 { 623 {