From a4b01ef38a735ffe70b402061871a9c99f2757ed Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Mar 2012 00:34:30 +0000 Subject: 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. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 31 +-------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs') 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 #endregion #region Get Methods + /// /// Get the controlling client for the given avatar, if there is one. /// @@ -1074,36 +1075,6 @@ namespace OpenSim.Region.Framework.Scenes return Entities.GetEntities(); } - public Dictionary GetTopScripts() - { - Dictionary topScripts = new Dictionary(); - - EntityBase[] EntityList = GetEntities(); - int limit = 0; - foreach (EntityBase ent in EntityList) - { - if (ent is SceneObjectGroup) - { - SceneObjectGroup grp = (SceneObjectGroup)ent; - if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) - { - if (grp.scriptScore >= 0.01) - { - topScripts.Add(grp.LocalId, grp.scriptScore); - limit++; - if (limit >= 100) - { - break; - } - } - grp.scriptScore = 0; - } - } - } - - return topScripts; - } - #endregion #region Other Methods -- cgit v1.1