aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-16 00:34:30 +0000
committerJustin Clark-Casey (justincc)2012-03-16 00:34:30 +0000
commita4b01ef38a735ffe70b402061871a9c99f2757ed (patch)
treeb60dcc1cbfaeb0cb0184f4b9619a7e95afe0a4de /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-a4b01ef38a735ffe70b402061871a9c99f2757ed.zip
opensim-SC_OLD-a4b01ef38a735ffe70b402061871a9c99f2757ed.tar.gz
opensim-SC_OLD-a4b01ef38a735ffe70b402061871a9c99f2757ed.tar.bz2
opensim-SC_OLD-a4b01ef38a735ffe70b402061871a9c99f2757ed.tar.xz
Replace script-lines-per-second with the script execution time scaled by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute. Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100. The actual measurement value should be script execution time per frame but XEngine does not work this way. Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time. This is still not ideal but gives reasonable results and allows scripts to be compared. This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs31
1 files changed, 1 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index bc3400a..5c542d6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -733,6 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
733 #endregion 733 #endregion
734 734
735 #region Get Methods 735 #region Get Methods
736
736 /// <summary> 737 /// <summary>
737 /// Get the controlling client for the given avatar, if there is one. 738 /// Get the controlling client for the given avatar, if there is one.
738 /// 739 ///
@@ -1074,36 +1075,6 @@ namespace OpenSim.Region.Framework.Scenes
1074 return Entities.GetEntities(); 1075 return Entities.GetEntities();
1075 } 1076 }
1076 1077
1077 public Dictionary<uint, float> GetTopScripts()
1078 {
1079 Dictionary<uint, float> topScripts = new Dictionary<uint, float>();
1080
1081 EntityBase[] EntityList = GetEntities();
1082 int limit = 0;
1083 foreach (EntityBase ent in EntityList)
1084 {
1085 if (ent is SceneObjectGroup)
1086 {
1087 SceneObjectGroup grp = (SceneObjectGroup)ent;
1088 if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
1089 {
1090 if (grp.scriptScore >= 0.01)
1091 {
1092 topScripts.Add(grp.LocalId, grp.scriptScore);
1093 limit++;
1094 if (limit >= 100)
1095 {
1096 break;
1097 }
1098 }
1099 grp.scriptScore = 0;
1100 }
1101 }
1102 }
1103
1104 return topScripts;
1105 }
1106
1107 #endregion 1078 #endregion
1108 1079
1109 #region Other Methods 1080 #region Other Methods