diff options
author | Justin Clark-Casey (justincc) | 2012-03-16 01:31:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-16 01:31:53 +0000 |
commit | c386b68373d0f4c46811423a2ba9ffbb486a1d9f (patch) | |
tree | aa2071710d83184ebcb7b19073355ab060fc58a1 | |
parent | Fix owner name display in "Top Colliders" and "Top Script" region reports. (diff) | |
download | opensim-SC_OLD-c386b68373d0f4c46811423a2ba9ffbb486a1d9f.zip opensim-SC_OLD-c386b68373d0f4c46811423a2ba9ffbb486a1d9f.tar.gz opensim-SC_OLD-c386b68373d0f4c46811423a2ba9ffbb486a1d9f.tar.bz2 opensim-SC_OLD-c386b68373d0f4c46811423a2ba9ffbb486a1d9f.tar.xz |
Aggregate script execution times by linksets rather than individual prims.
This is for the top scripts report.
4 files changed, 23 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 9fb4a25..9cab2e1 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -79,7 +79,10 @@ namespace OpenSim.Region.Framework.Interfaces | |||
79 | /// <summary> | 79 | /// <summary> |
80 | /// Get the execution times of all scripts in each object. | 80 | /// Get the execution times of all scripts in each object. |
81 | /// </summary> | 81 | /// </summary> |
82 | /// <returns>A dictionary where the key is a local object ID and the value is an execution time in milliseconds.</returns> | 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> | ||
83 | Dictionary<uint, float> GetObjectScriptsExecutionTimes(); | 86 | Dictionary<uint, float> GetObjectScriptsExecutionTimes(); |
84 | } | 87 | } |
85 | } \ No newline at end of file | 88 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 11f54a2..b04f6b6 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -99,6 +99,17 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
99 | string ScriptName { get; } | 99 | string ScriptName { get; } |
100 | UUID ItemID { get; } | 100 | UUID ItemID { get; } |
101 | UUID ObjectID { get; } | 101 | UUID ObjectID { get; } |
102 | |||
103 | /// <summary> | ||
104 | /// UUID of the root object for the linkset that the script is in. | ||
105 | /// </summary> | ||
106 | UUID RootObjectID { get; } | ||
107 | |||
108 | /// <summary> | ||
109 | /// Local id of the root object for the linkset that the script is in. | ||
110 | /// </summary> | ||
111 | uint RootLocalID { get; } | ||
112 | |||
102 | uint LocalID { get; } | 113 | uint LocalID { get; } |
103 | UUID AssetID { get; } | 114 | UUID AssetID { get; } |
104 | Queue EventQueue { get; } | 115 | Queue EventQueue { get; } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index b177287..6e36742 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 | |||
164 | 164 | ||
165 | public uint LocalID { get; private set; } | 165 | public uint LocalID { get; private set; } |
166 | 166 | ||
167 | public UUID RootObjectID { get; private set; } | ||
168 | |||
169 | public uint RootLocalID { get; private set; } | ||
170 | |||
167 | public UUID AssetID { get; private set; } | 171 | public UUID AssetID { get; private set; } |
168 | 172 | ||
169 | public Queue EventQueue { get; private set; } | 173 | public Queue EventQueue { get; private set; } |
@@ -198,6 +202,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
198 | Engine = engine; | 202 | Engine = engine; |
199 | LocalID = part.LocalId; | 203 | LocalID = part.LocalId; |
200 | ObjectID = part.UUID; | 204 | ObjectID = part.UUID; |
205 | RootLocalID = part.ParentGroup.LocalId; | ||
206 | RootObjectID = part.ParentGroup.UUID; | ||
201 | ItemID = itemID; | 207 | ItemID = itemID; |
202 | AssetID = assetID; | 208 | AssetID = assetID; |
203 | PrimName = primName; | 209 | PrimName = primName; |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index bddb1b9..3697f78 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1083,7 +1083,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1083 | 1083 | ||
1084 | if (!m_PrimObjects[localID].Contains(itemID)) | 1084 | if (!m_PrimObjects[localID].Contains(itemID)) |
1085 | m_PrimObjects[localID].Add(itemID); | 1085 | m_PrimObjects[localID].Add(itemID); |
1086 | |||
1087 | } | 1086 | } |
1088 | 1087 | ||
1089 | if (!m_Assemblies.ContainsKey(assetID)) | 1088 | if (!m_Assemblies.ContainsKey(assetID)) |
@@ -1901,7 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1901 | foreach (IScriptInstance si in m_Scripts.Values) | 1900 | foreach (IScriptInstance si in m_Scripts.Values) |
1902 | { | 1901 | { |
1903 | if (!topScripts.ContainsKey(si.LocalID)) | 1902 | if (!topScripts.ContainsKey(si.LocalID)) |
1904 | topScripts[si.LocalID] = 0; | 1903 | topScripts[si.RootLocalID] = 0; |
1905 | 1904 | ||
1906 | // long ticksElapsed = tickNow - si.MeasurementPeriodTickStart; | 1905 | // long ticksElapsed = tickNow - si.MeasurementPeriodTickStart; |
1907 | // float framesElapsed = ticksElapsed / (18.1818 * TimeSpan.TicksPerMillisecond); | 1906 | // float framesElapsed = ticksElapsed / (18.1818 * TimeSpan.TicksPerMillisecond); |
@@ -1937,7 +1936,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1937 | float adjustedExecutionTime | 1936 | float adjustedExecutionTime |
1938 | = ((float)si.MeasurementPeriodExecutionTime / ticksElapsed) * 18.1818f; | 1937 | = ((float)si.MeasurementPeriodExecutionTime / ticksElapsed) * 18.1818f; |
1939 | 1938 | ||
1940 | topScripts[si.LocalID] += adjustedExecutionTime; | 1939 | topScripts[si.RootLocalID] += adjustedExecutionTime; |
1941 | } | 1940 | } |
1942 | } | 1941 | } |
1943 | 1942 | ||