Aggregate script execution times by linksets rather than individual prims.

This is for the top scripts report.
0.7.3-post-fixes
Justin Clark-Casey (justincc) 2012-03-16 01:31:53 +00:00
parent 8206537efd
commit a74408d1d2
4 changed files with 23 additions and 4 deletions

View File

@ -79,7 +79,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// <summary> /// <summary>
/// Get the execution times of all scripts in each object. /// Get the execution times of all scripts in each object.
/// </summary> /// </summary>
/// <returns>A dictionary where the key is a local object ID and the value is an execution time in milliseconds.</returns> /// <returns>
/// 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.
/// </returns>
Dictionary<uint, float> GetObjectScriptsExecutionTimes(); Dictionary<uint, float> GetObjectScriptsExecutionTimes();
} }
} }

View File

@ -99,6 +99,17 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
string ScriptName { get; } string ScriptName { get; }
UUID ItemID { get; } UUID ItemID { get; }
UUID ObjectID { get; } UUID ObjectID { get; }
/// <summary>
/// UUID of the root object for the linkset that the script is in.
/// </summary>
UUID RootObjectID { get; }
/// <summary>
/// Local id of the root object for the linkset that the script is in.
/// </summary>
uint RootLocalID { get; }
uint LocalID { get; } uint LocalID { get; }
UUID AssetID { get; } UUID AssetID { get; }
Queue EventQueue { get; } Queue EventQueue { get; }

View File

@ -164,6 +164,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public uint LocalID { get; private set; } 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 UUID AssetID { get; private set; }
public Queue EventQueue { get; private set; } public Queue EventQueue { get; private set; }
@ -198,6 +202,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
Engine = engine; Engine = engine;
LocalID = part.LocalId; LocalID = part.LocalId;
ObjectID = part.UUID; ObjectID = part.UUID;
RootLocalID = part.ParentGroup.LocalId;
RootObjectID = part.ParentGroup.UUID;
ItemID = itemID; ItemID = itemID;
AssetID = assetID; AssetID = assetID;
PrimName = primName; PrimName = primName;

View File

@ -1083,7 +1083,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (!m_PrimObjects[localID].Contains(itemID)) if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID); m_PrimObjects[localID].Add(itemID);
} }
if (!m_Assemblies.ContainsKey(assetID)) if (!m_Assemblies.ContainsKey(assetID))
@ -1901,7 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
foreach (IScriptInstance si in m_Scripts.Values) foreach (IScriptInstance si in m_Scripts.Values)
{ {
if (!topScripts.ContainsKey(si.LocalID)) if (!topScripts.ContainsKey(si.LocalID))
topScripts[si.LocalID] = 0; topScripts[si.RootLocalID] = 0;
// long ticksElapsed = tickNow - si.MeasurementPeriodTickStart; // long ticksElapsed = tickNow - si.MeasurementPeriodTickStart;
// float framesElapsed = ticksElapsed / (18.1818 * TimeSpan.TicksPerMillisecond); // float framesElapsed = ticksElapsed / (18.1818 * TimeSpan.TicksPerMillisecond);
@ -1937,7 +1936,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
float adjustedExecutionTime float adjustedExecutionTime
= ((float)si.MeasurementPeriodExecutionTime / ticksElapsed) * 18.1818f; = ((float)si.MeasurementPeriodExecutionTime / ticksElapsed) * 18.1818f;
topScripts[si.LocalID] += adjustedExecutionTime; topScripts[si.RootLocalID] += adjustedExecutionTime;
} }
} }