diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 31 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 |
3 files changed, 13 insertions, 39 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 18c45dd..9cab2e1 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | 32 | ||
32 | namespace OpenSim.Region.Framework.Interfaces | 33 | namespace OpenSim.Region.Framework.Interfaces |
@@ -74,5 +75,14 @@ namespace OpenSim.Region.Framework.Interfaces | |||
74 | /// Starts the processing threads. | 75 | /// Starts the processing threads. |
75 | /// </summary> | 76 | /// </summary> |
76 | void StartProcessing(); | 77 | void StartProcessing(); |
78 | |||
79 | /// <summary> | ||
80 | /// Get the execution times of all scripts in each object. | ||
81 | /// </summary> | ||
82 | /// <returns> | ||
83 | /// A dictionary where the key is the root object ID of a linkset | ||
84 | /// and the value is a representative execution time in milliseconds of all scripts in that linkset. | ||
85 | /// </returns> | ||
86 | Dictionary<uint, float> GetObjectScriptsExecutionTimes(); | ||
77 | } | 87 | } |
78 | } | 88 | } \ No newline at end of file |
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 |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 878476e..afb5ccf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -229,8 +229,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
229 | get { return RootPart.VolumeDetectActive; } | 229 | get { return RootPart.VolumeDetectActive; } |
230 | } | 230 | } |
231 | 231 | ||
232 | public float scriptScore; | ||
233 | |||
234 | private Vector3 lastPhysGroupPos; | 232 | private Vector3 lastPhysGroupPos; |
235 | private Quaternion lastPhysGroupRot; | 233 | private Quaternion lastPhysGroupRot; |
236 | 234 | ||
@@ -1184,12 +1182,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1184 | 1182 | ||
1185 | public void AddScriptLPS(int count) | 1183 | public void AddScriptLPS(int count) |
1186 | { | 1184 | { |
1187 | if (scriptScore + count >= float.MaxValue - count) | 1185 | m_scene.SceneGraph.AddToScriptLPS(count); |
1188 | scriptScore = 0; | ||
1189 | |||
1190 | scriptScore += (float)count; | ||
1191 | SceneGraph d = m_scene.SceneGraph; | ||
1192 | d.AddToScriptLPS(count); | ||
1193 | } | 1186 | } |
1194 | 1187 | ||
1195 | public void AddActiveScriptCount(int count) | 1188 | public void AddActiveScriptCount(int count) |