diff options
author | Justin Clark-Casey (justincc) | 2012-02-01 00:07:06 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-02-01 00:07:06 +0000 |
commit | 437de6743c98b9ab217ac56ca6646883ca44c240 (patch) | |
tree | cf37c27e8934a33046c433acc861105a1a3b5201 /OpenSim | |
parent | Add "show part uuid" and "show part name" console commands. (diff) | |
download | opensim-SC_OLD-437de6743c98b9ab217ac56ca6646883ca44c240.zip opensim-SC_OLD-437de6743c98b9ab217ac56ca6646883ca44c240.tar.gz opensim-SC_OLD-437de6743c98b9ab217ac56ca6646883ca44c240.tar.bz2 opensim-SC_OLD-437de6743c98b9ab217ac56ca6646883ca44c240.tar.xz |
Implement "xengine status" console command to show various xengine stats
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 32 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.IO; | ||
30 | using System.Threading; | ||
31 | using System.Collections; | 29 | using System.Collections; |
32 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Globalization; | ||
32 | using System.IO; | ||
33 | using System.Reflection; | ||
33 | using System.Security; | 34 | using System.Security; |
34 | using System.Security.Policy; | 35 | using System.Security.Policy; |
35 | using System.Reflection; | 36 | using System.Text; |
36 | using System.Globalization; | 37 | using System.Threading; |
37 | using System.Xml; | 38 | using System.Xml; |
38 | using OpenMetaverse; | 39 | using OpenMetaverse; |
39 | using OpenMetaverse.StructuredData; | 40 | using 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) |