diff options
author | Teravus Ovares | 2008-05-25 20:50:45 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-25 20:50:45 +0000 |
commit | c20f7d6171a9df151c3ccde063336338da9ae322 (patch) | |
tree | a6093b52da4093e3b692771a421ce4a55052d24b /OpenSim/Region/Environment/Scenes/InnerScene.cs | |
parent | Thank you very much, Melanie for a patch that: (diff) | |
download | opensim-SC-c20f7d6171a9df151c3ccde063336338da9ae322.zip opensim-SC-c20f7d6171a9df151c3ccde063336338da9ae322.tar.gz opensim-SC-c20f7d6171a9df151c3ccde063336338da9ae322.tar.bz2 opensim-SC-c20f7d6171a9df151c3ccde063336338da9ae322.tar.xz |
* A hacky Top Scripts display. It isn't accurate as far as ms accounting, however you can use it to help find out what scripts are causing your simulator to cry.
* Access it from the Estate tools/Debug tab.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 84de71f..d6e905b 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs | |||
@@ -846,6 +846,37 @@ namespace OpenSim.Region.Environment.Scenes | |||
846 | return result; | 846 | return result; |
847 | } | 847 | } |
848 | 848 | ||
849 | public Dictionary<uint, float> GetTopScripts() | ||
850 | { | ||
851 | Dictionary<uint, float> topScripts = new Dictionary<uint, float>(); | ||
852 | |||
853 | List<EntityBase> EntityList = GetEntities(); | ||
854 | int limit = 0; | ||
855 | foreach (EntityBase ent in EntityList) | ||
856 | { | ||
857 | if (ent is SceneObjectGroup) | ||
858 | { | ||
859 | SceneObjectGroup grp = (SceneObjectGroup)ent; | ||
860 | if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Scripted) != 0) | ||
861 | { | ||
862 | if (grp.scriptScore >= 0.01) | ||
863 | { | ||
864 | topScripts.Add(grp.LocalId, grp.scriptScore); | ||
865 | limit++; | ||
866 | if (limit >= 100) | ||
867 | { | ||
868 | break; | ||
869 | } | ||
870 | |||
871 | } | ||
872 | grp.scriptScore = 0; | ||
873 | } | ||
874 | } | ||
875 | } | ||
876 | |||
877 | return topScripts; | ||
878 | } | ||
879 | |||
849 | #endregion | 880 | #endregion |
850 | 881 | ||
851 | #region Other Methods | 882 | #region Other Methods |