aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
diff options
context:
space:
mode:
authorOren Hurvitz2015-07-31 15:34:43 +0300
committerOren Hurvitz2015-08-11 08:44:26 +0100
commitd24528b3bc2c277edae3507428bfeb23e5d81f57 (patch)
tree87bed067dac438708be872a4ebc892de0e30a4ab /OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
parentChanged "Script Execution Time" to be the gross time, i.e. including handling... (diff)
downloadopensim-SC_OLD-d24528b3bc2c277edae3507428bfeb23e5d81f57.zip
opensim-SC_OLD-d24528b3bc2c277edae3507428bfeb23e5d81f57.tar.gz
opensim-SC_OLD-d24528b3bc2c277edae3507428bfeb23e5d81f57.tar.bz2
opensim-SC_OLD-d24528b3bc2c277edae3507428bfeb23e5d81f57.tar.xz
Show Script Time in the statistics panel
The value shown is the number of milliseconds per frame that were spent executing scripts in this region.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SimStatsReporter.cs80
1 files changed, 42 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 8918c3b..4847696 100755
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes
63 63
64 // Determines the size of the array that is used to collect StatBlocks 64 // Determines the size of the array that is used to collect StatBlocks
65 // for sending to the SimStats and SimExtraStatsCollector 65 // for sending to the SimStats and SimExtraStatsCollector
66 private const int m_statisticArraySize = 27; 66 private const int m_statisticArraySize = 28;
67 67
68 /// <summary> 68 /// <summary>
69 /// These are the IDs of stats sent in the StatsPacket to the viewer. 69 /// These are the IDs of stats sent in the StatsPacket to the viewer.
@@ -204,9 +204,7 @@ namespace OpenSim.Region.Framework.Scenes
204 private int m_physicsMS; 204 private int m_physicsMS;
205 private int m_imageMS; 205 private int m_imageMS;
206 private int m_otherMS; 206 private int m_otherMS;
207 207 private int m_scriptMS;
208//Ckrinke: (3-21-08) Comment out to remove a compiler warning. Bring back into play when needed.
209//Ckrinke private int m_scriptMS = 0;
210 208
211 private int m_rootAgents; 209 private int m_rootAgents;
212 private int m_childAgents; 210 private int m_childAgents;
@@ -428,7 +426,8 @@ namespace OpenSim.Region.Framework.Scenes
428 // values to X-per-second values. 426 // values to X-per-second values.
429 427
430 uint thisFrame = m_scene.Frame; 428 uint thisFrame = m_scene.Frame;
431 float framesUpdated = (float)(thisFrame - m_lastUpdateFrame) * m_reportedFpsCorrectionFactor; 429 uint numFrames = thisFrame - m_lastUpdateFrame;
430 float framesUpdated = (float)numFrames * m_reportedFpsCorrectionFactor;
432 m_lastUpdateFrame = thisFrame; 431 m_lastUpdateFrame = thisFrame;
433 432
434 // Avoid div-by-zero if somehow we've not updated any frames. 433 // Avoid div-by-zero if somehow we've not updated any frames.
@@ -501,23 +500,22 @@ namespace OpenSim.Region.Framework.Scenes
501 // statistics to the statistics window 500 // statistics to the statistics window
502 sb[8].StatID = (uint)Stats.FrameMS; 501 sb[8].StatID = (uint)Stats.FrameMS;
503 //sb[8].StatValue = m_frameMS / framesUpdated; 502 //sb[8].StatValue = m_frameMS / framesUpdated;
504 sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored; 503 sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored;
505 504
506 sb[9].StatID = (uint)Stats.NetMS; 505 sb[9].StatID = (uint)Stats.NetMS;
507 //sb[9].StatValue = m_netMS / framesUpdated; 506 //sb[9].StatValue = m_netMS / framesUpdated;
508 sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored; 507 sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored;
509 508
510 sb[10].StatID = (uint)Stats.PhysicsMS; 509 sb[10].StatID = (uint)Stats.PhysicsMS;
511 //sb[10].StatValue = m_physicsMS / framesUpdated; 510 //sb[10].StatValue = m_physicsMS / framesUpdated;
512 sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored; 511 sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored;
513 512
514 sb[11].StatID = (uint)Stats.ImageMS ; 513 sb[11].StatID = (uint)Stats.ImageMS ;
515 sb[11].StatValue = m_imageMS / framesUpdated; 514 sb[11].StatValue = m_imageMS / framesUpdated;
516 515
517 sb[12].StatID = (uint)Stats.OtherMS; 516 sb[12].StatID = (uint)Stats.OtherMS;
518 //sb[12].StatValue = m_otherMS / framesUpdated; 517 //sb[12].StatValue = m_otherMS / framesUpdated;
519 sb[12].StatValue = (float) simulationSumFrameTime / 518 sb[12].StatValue = (float) simulationSumFrameTime / m_numberFramesStored;
520 m_numberFramesStored;
521 519
522 sb[13].StatID = (uint)Stats.InPacketsPerSecond; 520 sb[13].StatID = (uint)Stats.InPacketsPerSecond;
523 sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor); 521 sb[13].StatValue = (m_inPacketsPerSecond / m_statsUpdateFactor);
@@ -567,6 +565,9 @@ namespace OpenSim.Region.Framework.Scenes
567 sb[26].StatID = (uint)Stats.ThreadCount; 565 sb[26].StatID = (uint)Stats.ThreadCount;
568 sb[26].StatValue = m_inUseThreads; 566 sb[26].StatValue = m_inUseThreads;
569 567
568 sb[27].StatID = (uint)Stats.ScriptMS;
569 sb[27].StatValue = (numFrames <= 0) ? 0 : ((float)m_scriptMS / numFrames);
570
570 for (int i = 0; i < m_statisticArraySize; i++) 571 for (int i = 0; i < m_statisticArraySize; i++)
571 { 572 {
572 lastReportedSimStats[i] = sb[i].StatValue; 573 lastReportedSimStats[i] = sb[i].StatValue;
@@ -632,10 +633,8 @@ namespace OpenSim.Region.Framework.Scenes
632 m_physicsMS = 0; 633 m_physicsMS = 0;
633 m_imageMS = 0; 634 m_imageMS = 0;
634 m_otherMS = 0; 635 m_otherMS = 0;
636 m_scriptMS = 0;
635 m_spareMS = 0; 637 m_spareMS = 0;
636
637//Ckrinke This variable is not used, so comment to remove compiler warning until it is used.
638//Ckrinke m_scriptMS = 0;
639 } 638 }
640 639
641 # region methods called from Scene 640 # region methods called from Scene
@@ -746,31 +745,36 @@ namespace OpenSim.Region.Framework.Scenes
746 m_otherMS += ms; 745 m_otherMS += ms;
747 } 746 }
748 747
749 public void addPhysicsFrame(int frames) 748 public void AddScriptMS(int ms)
750 { 749 {
751 // Add the number of physics frames to the correct total physics 750 m_scriptMS += ms;
752 // frames 751 }
753 m_numberPhysicsFrames += frames; 752
754 } 753 public void addPhysicsFrame(int frames)
755 754 {
756 public void addFrameTimeMilliseconds(double total, double simulation, 755 // Add the number of physics frames to the correct total physics
757 double physics, double network) 756 // frames
758 { 757 m_numberPhysicsFrames += frames;
759 // Save the frame times from the current frame into the appropriate 758 }
760 // arrays 759
761 m_totalFrameTimeMilliseconds[m_nextLocation] = total; 760 public void addFrameTimeMilliseconds(double total, double simulation,
762 m_simulationFrameTimeMilliseconds[m_nextLocation] = simulation; 761 double physics, double network)
763 m_physicsFrameTimeMilliseconds[m_nextLocation] = physics; 762 {
764 m_networkFrameTimeMilliseconds[m_nextLocation] = network; 763 // Save the frame times from the current frame into the appropriate
765 764 // arrays
766 // Update to the next location in the list 765 m_totalFrameTimeMilliseconds[m_nextLocation] = total;
767 m_nextLocation++; 766 m_simulationFrameTimeMilliseconds[m_nextLocation] = simulation;
768 767 m_physicsFrameTimeMilliseconds[m_nextLocation] = physics;
769 // Since the list will begin to overwrite the oldest frame values 768 m_networkFrameTimeMilliseconds[m_nextLocation] = network;
770 // first, the next location needs to loop back to the beginning of the 769
771 // list whenever it reaches the end 770 // Update to the next location in the list
772 m_nextLocation = m_nextLocation % m_numberFramesStored; 771 m_nextLocation++;
773 } 772
773 // Since the list will begin to overwrite the oldest frame values
774 // first, the next location needs to loop back to the beginning of the
775 // list whenever it reaches the end
776 m_nextLocation = m_nextLocation % m_numberFramesStored;
777 }
774 778
775 public void AddPendingDownloads(int count) 779 public void AddPendingDownloads(int count)
776 { 780 {