aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs26
1 files changed, 10 insertions, 16 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index f0f8d01..cbab2db 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -37,6 +37,7 @@ using log4net;
37using log4net.Appender; 37using log4net.Appender;
38using log4net.Core; 38using log4net.Core;
39using log4net.Repository; 39using log4net.Repository;
40using OpenSim.Framework;
40using OpenSim.Framework.Console; 41using OpenSim.Framework.Console;
41using OpenSim.Framework.Servers; 42using OpenSim.Framework.Servers;
42using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
@@ -234,26 +235,19 @@ namespace OpenSim.Framework.Servers
234 protected string GetThreadsReport() 235 protected string GetThreadsReport()
235 { 236 {
236 StringBuilder sb = new StringBuilder(); 237 StringBuilder sb = new StringBuilder();
238 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
237 239
238 ProcessThreadCollection threads = ThreadTracker.GetThreads(); 240 sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
239 if (threads == null) 241 foreach (Watchdog.ThreadWatchdogInfo twi in threads)
240 { 242 {
241 sb.Append("OpenSim thread tracking is only enabled in DEBUG mode."); 243 Thread t = twi.Thread;
244
245 sb.Append(
246 "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", TimeRunning: "
247 + "Pri: " + t.Priority + ", State: " + t.ThreadState);
248 sb.Append(Environment.NewLine);
242 } 249 }
243 else
244 {
245 sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine);
246 foreach (ProcessThread t in threads)
247 {
248 sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " +
249 (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState);
250 if (t.ThreadState == System.Diagnostics.ThreadState.Wait)
251 sb.Append(", Reason: " + t.WaitReason + Environment.NewLine);
252 else
253 sb.Append(Environment.NewLine);
254 250
255 }
256 }
257 int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; 251 int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
258 ThreadPool.GetAvailableThreads(out workers, out ports); 252 ThreadPool.GetAvailableThreads(out workers, out ports);
259 ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts); 253 ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);