aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorMelanie2012-04-13 03:00:48 +0100
committerMelanie2012-04-13 03:00:48 +0100
commitfe65b518765a8c88c1f3067b47d775b9b1142961 (patch)
tree3a97f13715090d8c925543ae49ecae1930578d5d /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentMerge branch 'master' into careminster (diff)
parentMantis 55025 Implement script time. (diff)
downloadopensim-SC_OLD-fe65b518765a8c88c1f3067b47d775b9b1142961.zip
opensim-SC_OLD-fe65b518765a8c88c1f3067b47d775b9b1142961.tar.gz
opensim-SC_OLD-fe65b518765a8c88c1f3067b47d775b9b1142961.tar.bz2
opensim-SC_OLD-fe65b518765a8c88c1f3067b47d775b9b1142961.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5786f48..ced3fb5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4032,6 +4032,45 @@ namespace OpenSim.Region.Framework.Scenes
4032 } 4032 }
4033 4033
4034 /// <summary> 4034 /// <summary>
4035 /// A float the value is a representative execution time in milliseconds of all scripts in the link set.
4036 /// </summary>
4037 public float ScriptExecutionTime()
4038 {
4039 IScriptModule[] engines = Scene.RequestModuleInterfaces<IScriptModule>();
4040
4041 if (engines.Length == 0) // No engine at all
4042 return 0.0f;
4043
4044 float time = 0.0f;
4045
4046 // get all the scripts in all parts
4047 SceneObjectPart[] parts = m_parts.GetArray();
4048 List<TaskInventoryItem> scripts = new List<TaskInventoryItem>();
4049 for (int i = 0; i < parts.Length; i++)
4050 {
4051 scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
4052 }
4053 // extract the UUIDs
4054 List<UUID> ids = new List<UUID>(scripts.Count);
4055 foreach (TaskInventoryItem script in scripts)
4056 {
4057 if (!ids.Contains(script.ItemID))
4058 {
4059 ids.Add(script.ItemID);
4060 }
4061 }
4062 // Offer the list of script UUIDs to each engine found and accumulate the time
4063 foreach (IScriptModule e in engines)
4064 {
4065 if (e != null)
4066 {
4067 time += e.GetScriptExecutionTime(ids);
4068 }
4069 }
4070 return time;
4071 }
4072
4073 /// <summary>
4035 /// Returns a count of the number of running scripts in this groups parts. 4074 /// Returns a count of the number of running scripts in this groups parts.
4036 /// </summary> 4075 /// </summary>
4037 public int RunningScriptCount() 4076 public int RunningScriptCount()