Aggregate script execution times by linksets rather than individual prims.
This is for the top scripts report.0.7.4.1
parent
7df4a544fe
commit
c386b68373
|
@ -79,7 +79,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// <summary>
|
||||
/// Get the execution times of all scripts in each object.
|
||||
/// </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();
|
||||
}
|
||||
}
|
|
@ -99,6 +99,17 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
|||
string ScriptName { get; }
|
||||
UUID ItemID { 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; }
|
||||
UUID AssetID { get; }
|
||||
Queue EventQueue { get; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue