aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseOpenSimServer.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs21
1 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 66d0813..3551d5d 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -243,17 +243,32 @@ namespace OpenSim.Framework.Servers
243 /// </summary> 243 /// </summary>
244 protected string GetThreadsReport() 244 protected string GetThreadsReport()
245 { 245 {
246 // This should be a constant field.
247 string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
248
246 StringBuilder sb = new StringBuilder(); 249 StringBuilder sb = new StringBuilder();
247 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads(); 250 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
248 251
249 sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine); 252 sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
253
254 int timeNow = Util.EnvironmentTickCount();
255
256 sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "LIFETIME (MS)", "PRIORITY", "STATE");
257 sb.Append(Environment.NewLine);
258
250 foreach (Watchdog.ThreadWatchdogInfo twi in threads) 259 foreach (Watchdog.ThreadWatchdogInfo twi in threads)
251 { 260 {
252 Thread t = twi.Thread; 261 Thread t = twi.Thread;
253 262
254 sb.Append( 263 sb.AppendFormat(
255 "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", TimeRunning: " 264 reportFormat,
256 + "Pri: " + t.Priority + ", State: " + t.ThreadState); 265 t.ManagedThreadId,
266 t.Name,
267 timeNow - twi.LastTick,
268 timeNow - twi.FirstTick,
269 t.Priority,
270 t.ThreadState);
271
257 sb.Append(Environment.NewLine); 272 sb.Append(Environment.NewLine);
258 } 273 }
259 274