mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Add "debug threadpool status" console command to show min/max/current worker/iocp threadpool numbers
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user