diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index 9fb4a25009..9cab2e185b 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -79,7 +79,10 @@ namespace OpenSim.Region.Framework.Interfaces
///
/// Get the execution times of all scripts in each object.
///
- /// A dictionary where the key is a local object ID and the value is an execution time in milliseconds.
+ ///
+ /// A dictionary where the key is the root object ID of a linkset
+ /// and the value is a representative execution time in milliseconds of all scripts in that linkset.
+ ///
Dictionary GetObjectScriptsExecutionTimes();
}
}
\ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index 11f54a267c..b04f6b6624 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -99,6 +99,17 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
string ScriptName { get; }
UUID ItemID { get; }
UUID ObjectID { get; }
+
+ ///
+ /// UUID of the root object for the linkset that the script is in.
+ ///
+ UUID RootObjectID { get; }
+
+ ///
+ /// Local id of the root object for the linkset that the script is in.
+ ///
+ uint RootLocalID { get; }
+
uint LocalID { get; }
UUID AssetID { get; }
Queue EventQueue { get; }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index b17728758a..6e367421c0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -164,6 +164,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public uint LocalID { get; private set; }
+ public UUID RootObjectID { get; private set; }
+
+ public uint RootLocalID { get; private set; }
+
public UUID AssetID { get; private set; }
public Queue EventQueue { get; private set; }
@@ -198,6 +202,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
Engine = engine;
LocalID = part.LocalId;
ObjectID = part.UUID;
+ RootLocalID = part.ParentGroup.LocalId;
+ RootObjectID = part.ParentGroup.UUID;
ItemID = itemID;
AssetID = assetID;
PrimName = primName;
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 92149425ba..5a6b8724b4 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1083,7 +1083,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
-
}
if (!m_Assemblies.ContainsKey(assetID))
@@ -1901,7 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (IScriptInstance si in m_Scripts.Values)
{
if (!topScripts.ContainsKey(si.LocalID))
- topScripts[si.LocalID] = 0;
+ topScripts[si.RootLocalID] = 0;
// long ticksElapsed = tickNow - si.MeasurementPeriodTickStart;
// float framesElapsed = ticksElapsed / (18.1818 * TimeSpan.TicksPerMillisecond);
@@ -1937,7 +1936,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
float adjustedExecutionTime
= ((float)si.MeasurementPeriodExecutionTime / ticksElapsed) * 18.1818f;
- topScripts[si.LocalID] += adjustedExecutionTime;
+ topScripts[si.RootLocalID] += adjustedExecutionTime;
}
}