Changed "Script Execution Time" to be the gross time, i.e. including handling it in XEngine
Previously the "Net Time" was reported: only the time actually spent in the script's code. This is not a correct indication of how much load the script places on the simulator, because scripts that change state often or have many events use up a lot of time just in the event handlers, and previously this time wasn't counted.0.8.2-post-fixes
parent
a3bed1fbcb
commit
5679cd0100
|
@ -753,6 +753,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
if (Suspended)
|
if (Suspended)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Stopwatch timer = new Stopwatch();
|
||||||
|
timer.Start();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return EventProcessorInt();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
timer.Stop();
|
||||||
|
ExecutionTime.AddSample(timer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private object EventProcessorInt()
|
||||||
|
{
|
||||||
EventParams data = null;
|
EventParams data = null;
|
||||||
|
|
||||||
lock (EventQueue)
|
lock (EventQueue)
|
||||||
|
@ -825,8 +842,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
if (Engine.World.PipeEventsForScript(LocalID) ||
|
if (Engine.World.PipeEventsForScript(LocalID) ||
|
||||||
data.EventName == "control") // Don't freeze avies!
|
data.EventName == "control") // Don't freeze avies!
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}",
|
// m_log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}",
|
||||||
// PrimName, ScriptName, data.EventName, State);
|
// PrimName, ScriptName, data.EventName, State);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -834,16 +851,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
m_EventStart = DateTime.Now;
|
m_EventStart = DateTime.Now;
|
||||||
m_InEvent = true;
|
m_InEvent = true;
|
||||||
|
|
||||||
Stopwatch timer = new Stopwatch();
|
try
|
||||||
timer.Start();
|
{
|
||||||
|
|
||||||
m_Script.ExecuteEvent(State, data.EventName, data.Params);
|
m_Script.ExecuteEvent(State, data.EventName, data.Params);
|
||||||
|
}
|
||||||
timer.Stop();
|
finally
|
||||||
ExecutionTime.AddSample(timer);
|
{
|
||||||
|
|
||||||
m_InEvent = false;
|
m_InEvent = false;
|
||||||
m_CurrentEvent = String.Empty;
|
m_CurrentEvent = String.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_SaveState)
|
if (m_SaveState)
|
||||||
{
|
{
|
||||||
|
@ -857,12 +873,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCRIPT] Exception in script {0} {1}: {2}{3}",
|
// "[SCRIPT] Exception in script {0} {1}: {2}{3}",
|
||||||
// ScriptName, ItemID, e.Message, e.StackTrace);
|
// ScriptName, ItemID, e.Message, e.StackTrace);
|
||||||
|
|
||||||
m_InEvent = false;
|
|
||||||
m_CurrentEvent = String.Empty;
|
|
||||||
|
|
||||||
if ((!(e is TargetInvocationException)
|
if ((!(e is TargetInvocationException)
|
||||||
|| (!(e.InnerException is SelfDeleteException)
|
|| (!(e.InnerException is SelfDeleteException)
|
||||||
|
@ -955,7 +968,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public int EventTime()
|
public int EventTime()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue