From ac198068ab7bb3895d95c6d1902b2c6af575a32a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 6 Aug 2013 00:00:12 +0100 Subject: Add "debug threadpool status" console command to show min/max/current worker/iocp threadpool numbers --- OpenSim/Framework/Servers/ServerBase.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'OpenSim/Framework/Servers') diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 1bee6a3..c258ff6 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -274,6 +274,12 @@ namespace OpenSim.Framework.Servers "Set threadpool parameters. For debug purposes.", HandleDebugThreadpoolSet); + m_console.Commands.AddCommand ( + "Debug", false, "debug threadpool status", + "debug threadpool status", + "Show current debug threadpool parameters.", + HandleDebugThreadpoolStatus); + m_console.Commands.AddCommand( "Debug", false, "force gc", "force gc", @@ -337,6 +343,23 @@ namespace OpenSim.Framework.Servers Notice("serialosdreq is now {0}", setSerializeOsdRequests); } + private void HandleDebugThreadpoolStatus(string module, string[] args) + { + int workerThreads, iocpThreads; + + ThreadPool.GetMinThreads(out workerThreads, out iocpThreads); + Notice("Min worker threads: {0}", workerThreads); + Notice("Min IOCP threads: {0}", iocpThreads); + + ThreadPool.GetMaxThreads(out workerThreads, out iocpThreads); + Notice("Max worker threads: {0}", workerThreads); + Notice("Max IOCP threads: {0}", iocpThreads); + + ThreadPool.GetAvailableThreads(out workerThreads, out iocpThreads); + Notice("Available worker threads: {0}", workerThreads); + Notice("Available IOCP threads: {0}", iocpThreads); + } + private void HandleDebugThreadpoolSet(string module, string[] args) { if (args.Length != 6) -- cgit v1.1