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-19 21:31:38 +0000
commita9a77bb3ab73b96e95daafa6dccfe438439f1aef (patch)
tree0e3e7491b97a1a390e80e618bef9b18f93397bbf /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentRemove property/field duplication in ScriptInstance where it's unnecessary. (diff)
downloadopensim-SC_OLD-a9a77bb3ab73b96e95daafa6dccfe438439f1aef.zip
opensim-SC_OLD-a9a77bb3ab73b96e95daafa6dccfe438439f1aef.tar.gz
opensim-SC_OLD-a9a77bb3ab73b96e95daafa6dccfe438439f1aef.tar.bz2
opensim-SC_OLD-a9a77bb3ab73b96e95daafa6dccfe438439f1aef.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 66fb493..743b8ef 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -751,6 +751,7 @@ namespace OpenSim.Region.Framework.Scenes
751 #endregion 751 #endregion
752 752
753 #region Get Methods 753 #region Get Methods
754
754 /// <summary> 755 /// <summary>
755 /// Get the controlling client for the given avatar, if there is one. 756 /// Get the controlling client for the given avatar, if there is one.
756 /// 757 ///
@@ -1092,36 +1093,6 @@ namespace OpenSim.Region.Framework.Scenes
1092 return Entities.GetEntities(); 1093 return Entities.GetEntities();
1093 } 1094 }
1094 1095
1095 public Dictionary<uint, float> GetTopScripts()
1096 {
1097 Dictionary<uint, float> topScripts = new Dictionary<uint, float>();
1098
1099 EntityBase[] EntityList = GetEntities();
1100 int limit = 0;
1101 foreach (EntityBase ent in EntityList)
1102 {
1103 if (ent is SceneObjectGroup)
1104 {
1105 SceneObjectGroup grp = (SceneObjectGroup)ent;
1106 if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
1107 {
1108 if (grp.scriptScore >= 0.01)
1109 {
1110 topScripts.Add(grp.LocalId, grp.scriptScore);
1111 limit++;
1112 if (limit >= 100)
1113 {
1114 break;
1115 }
1116 }
1117 grp.scriptScore = 0;
1118 }
1119 }
1120 }
1121
1122 return topScripts;
1123 }
1124
1125 #endregion 1096 #endregion
1126 1097
1127 #region Other Methods 1098 #region Other Methods