From a4b01ef38a735ffe70b402061871a9c99f2757ed Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 16 Mar 2012 00:34:30 +0000
Subject: Replace script-lines-per-second with the script execution time scaled
by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute.
Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100.
The actual measurement value should be script execution time per frame but XEngine does not work this way.
Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time.
This is still not ideal but gives reasonable results and allows scripts to be compared.
This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
---
OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'OpenSim/Region/ScriptEngine/Interfaces')
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
index 8762642..11f54a2 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs
@@ -78,6 +78,21 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
///
string State { get; set; }
+ ///
+ /// Time the script was last started
+ ///
+ DateTime TimeStarted { get; }
+
+ ///
+ /// Tick the last measurement period was started.
+ ///
+ long MeasurementPeriodTickStart { get; }
+
+ ///
+ /// Ticks spent executing in the last measurement period.
+ ///
+ long MeasurementPeriodExecutionTime { get; }
+
IScriptEngine Engine { get; }
UUID AppDomain { get; set; }
string PrimName { get; }
--
cgit v1.1