Improve threadpool reporting to "show threads" console command (also gets printed out periodically)

This commit is contained in:
Justin Clark-Casey (justincc)
2012-03-16 03:26:47 +00:00
parent 421b562a04
commit 6e8f80f1ab
2 changed files with 57 additions and 7 deletions

View File

@@ -272,12 +272,8 @@ namespace OpenSim.Framework.Servers
sb.Append(Environment.NewLine);
}
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
ThreadPool.GetAvailableThreads(out workers, out ports);
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
sb.Append("\n*** Main threadpool (excluding script engine)***\n");
sb.Append(Util.GetThreadPoolReport());
return sb.ToString();
}