Add IScriptInstance.EventsProcessed stat so that we can record this information and display in "show scripts" for debug purposes

0.7.4-extended
Justin Clark-Casey (justincc) 2012-12-05 22:33:28 +00:00
parent 6d03a5d01b
commit c2bdb36c11
3 changed files with 10 additions and 0 deletions

View File

@ -114,6 +114,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
UUID AssetID { get; } UUID AssetID { get; }
Queue EventQueue { get; } Queue EventQueue { get; }
/// <summary>
/// Number of events processed by this script instance.
/// </summary>
long EventsProcessed { get; }
void ClearQueue(); void ClearQueue();
int StartParam { get; set; } int StartParam { get; set; }

View File

@ -173,6 +173,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
public Queue EventQueue { get; private set; } public Queue EventQueue { get; private set; }
public long EventsProcessed { get; private set; }
public int StartParam { get; set; } public int StartParam { get; set; }
public TaskInventoryItem ScriptTask { get; private set; } public TaskInventoryItem ScriptTask { get; private set; }
@ -808,6 +810,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
// script engine to run the next event. // script engine to run the next event.
lock (EventQueue) lock (EventQueue)
{ {
EventsProcessed++;
if (EventQueue.Count > 0 && Running && !ShuttingDown) if (EventQueue.Count > 0 && Running && !ShuttingDown)
{ {
m_CurrentWorkItem = Engine.QueueEventHandler(this); m_CurrentWorkItem = Engine.QueueEventHandler(this);

View File

@ -512,6 +512,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
lock (eq) lock (eq)
sb.AppendFormat("Queued events : {0}\n", eq.Count); sb.AppendFormat("Queued events : {0}\n", eq.Count);
sb.AppendFormat("Processed events : {0}\n", instance.EventsProcessed);
sb.AppendFormat("Item UUID : {0}\n", instance.ItemID); sb.AppendFormat("Item UUID : {0}\n", instance.ItemID);
sb.AppendFormat("Containing part name: {0}\n", instance.PrimName); sb.AppendFormat("Containing part name: {0}\n", instance.PrimName);
sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID); sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID);