diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 11 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e47aa9c..c61a23d 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1904,14 +1904,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1904 | } | 1904 | } |
1905 | 1905 | ||
1906 | /// <summary> | 1906 | /// <summary> |
1907 | /// Returns the total execution time of all the scripts in the region since the last frame | 1907 | /// Returns the total execution time of all the scripts in the region since the last call |
1908 | /// (in milliseconds), and clears the value in preparation for the next frame. | 1908 | /// (in milliseconds), and clears the value in preparation for the next call. |
1909 | /// </summary> | 1909 | /// </summary> |
1910 | /// <returns>Time in milliseconds</returns> | 1910 | /// <returns>Time in milliseconds</returns> |
1911 | private long GetAndResetScriptExecutionTime() | 1911 | |
1912 | // Warning: this is now called from StatsReporter, and can't be shared | ||
1913 | |||
1914 | public long GetAndResetScriptExecutionTime() | ||
1912 | { | 1915 | { |
1913 | long ticks = Interlocked.Exchange(ref m_scriptExecutionTime, 0); | 1916 | long ticks = Interlocked.Exchange(ref m_scriptExecutionTime, 0); |
1914 | return (ticks * 1000) / Stopwatch.Frequency; | 1917 | return (ticks * 1000L) / Stopwatch.Frequency; |
1915 | } | 1918 | } |
1916 | 1919 | ||
1917 | public void AddGroupTarget(SceneObjectGroup grp) | 1920 | public void AddGroupTarget(SceneObjectGroup grp) |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 7f6a1cd..5fe0551 100755 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -412,6 +412,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
412 | if (m_otherMS < 0) | 412 | if (m_otherMS < 0) |
413 | m_otherMS = 0; | 413 | m_otherMS = 0; |
414 | 414 | ||
415 | float scriptTimeMS = m_scene.GetAndResetScriptExecutionTime(); | ||
416 | |||
415 | for (int i = 0; i < m_statisticViewerArraySize; i++) | 417 | for (int i = 0; i < m_statisticViewerArraySize; i++) |
416 | { | 418 | { |
417 | sb[i] = new SimStatsPacket.StatBlock(); | 419 | sb[i] = new SimStatsPacket.StatBlock(); |
@@ -533,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
533 | sb[36].StatValue = 0; | 535 | sb[36].StatValue = 0; |
534 | 536 | ||
535 | sb[37].StatID = (uint)Stats.ScriptMS; | 537 | sb[37].StatID = (uint)Stats.ScriptMS; |
536 | sb[37].StatValue = 0; | 538 | sb[37].StatValue = scriptTimeMS * perframefactor; |
537 | 539 | ||
538 | 540 | ||
539 | for (int i = 0; i < m_statisticViewerArraySize; i++) | 541 | for (int i = 0; i < m_statisticViewerArraySize; i++) |