aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-01 00:07:06 +0000
committerJustin Clark-Casey (justincc)2012-02-01 00:07:06 +0000
commit437de6743c98b9ab217ac56ca6646883ca44c240 (patch)
treecf37c27e8934a33046c433acc861105a1a3b5201 /OpenSim/Region/ScriptEngine/XEngine
parentAdd "show part uuid" and "show part name" console commands. (diff)
downloadopensim-SC-437de6743c98b9ab217ac56ca6646883ca44c240.zip
opensim-SC-437de6743c98b9ab217ac56ca6646883ca44c240.tar.gz
opensim-SC-437de6743c98b9ab217ac56ca6646883ca44c240.tar.bz2
opensim-SC-437de6743c98b9ab217ac56ca6646883ca44c240.tar.xz
Implement "xengine status" console command to show various xengine stats
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs32
1 files changed, 28 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index c9bbf0e..c9fb722 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -26,14 +26,15 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.IO;
30using System.Threading;
31using System.Collections; 29using System.Collections;
32using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Globalization;
32using System.IO;
33using System.Reflection;
33using System.Security; 34using System.Security;
34using System.Security.Policy; 35using System.Security.Policy;
35using System.Reflection; 36using System.Text;
36using System.Globalization; 37using System.Threading;
37using System.Xml; 38using System.Xml;
38using OpenMetaverse; 39using OpenMetaverse;
39using OpenMetaverse.StructuredData; 40using OpenMetaverse.StructuredData;
@@ -273,6 +274,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
273 } 274 }
274 275
275 MainConsole.Instance.Commands.AddCommand( 276 MainConsole.Instance.Commands.AddCommand(
277 "scripts", false, "xengine status", "xengine status", "Show status information",
278 "Show status information on the script engine.",
279 HandleShowStatus);
280
281 MainConsole.Instance.Commands.AddCommand(
276 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information", 282 "scripts", false, "scripts show", "scripts show [<script-item-uuid>]", "Show script information",
277 "Show information on all scripts known to the script engine." 283 "Show information on all scripts known to the script engine."
278 + "If a <script-item-uuid> is given then only information on that script will be shown.", 284 + "If a <script-item-uuid> is given then only information on that script will be shown.",
@@ -359,6 +365,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
359 } 365 }
360 } 366 }
361 367
368 private void HandleShowStatus(string module, string[] cmdparams)
369 {
370 StringBuilder sb = new StringBuilder();
371 sb.AppendFormat("Status of XEngine instance for {0}\n", m_Scene.RegionInfo.RegionName);
372
373 lock (m_Scripts)
374 sb.AppendFormat("Scripts loaded : {0}\n", m_Scripts.Count);
375
376 sb.AppendFormat("Unique scripts : {0}\n", m_uniqueScripts.Count);
377 sb.AppendFormat("Scripts waiting for load : {0}\n", m_CompileQueue.Count);
378 sb.AppendFormat("Allocated threads : {0}\n", m_ThreadPool.ActiveThreads);
379 sb.AppendFormat("In use threads : {0}\n", m_ThreadPool.InUseThreads);
380 sb.AppendFormat("Work items waiting : {0}\n", m_ThreadPool.WaitingCallbacks);
381// sb.AppendFormat("Assemblies loaded : {0}\n", m_Assemblies.Count);
382
383 MainConsole.Instance.OutputFormat(sb.ToString());
384 }
385
362 public void HandleShowScripts(string module, string[] cmdparams) 386 public void HandleShowScripts(string module, string[] cmdparams)
363 { 387 {
364 if (cmdparams.Length == 2) 388 if (cmdparams.Length == 2)