diff options
author | Justin Clarke Casey | 2008-08-25 23:21:07 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-08-25 23:21:07 +0000 |
commit | 4a475ca2be259cf3e31b29148f04f325b304a6c5 (patch) | |
tree | 35e658b5819d14ad4e33a283d5e69ef2c9f56c31 | |
parent | * Added Zha to Contributors for OGP patch. (diff) | |
download | opensim-SC-4a475ca2be259cf3e31b29148f04f325b304a6c5.zip opensim-SC-4a475ca2be259cf3e31b29148f04f325b304a6c5.tar.gz opensim-SC-4a475ca2be259cf3e31b29148f04f325b304a6c5.tar.bz2 opensim-SC-4a475ca2be259cf3e31b29148f04f325b304a6c5.tar.xz |
* minor: refactor thread report into a method that returns a string rather than displays information directly
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 44 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 2 |
4 files changed, 31 insertions, 18 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 29ee143..ea3eed1 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -110,6 +110,32 @@ namespace OpenSim.Framework.Servers | |||
110 | 110 | ||
111 | m_log.Debug(sb); | 111 | m_log.Debug(sb); |
112 | } | 112 | } |
113 | |||
114 | /// <summary> | ||
115 | /// Get a report about the registered threads in this server. | ||
116 | /// </summary> | ||
117 | protected string GetThreadReport() | ||
118 | { | ||
119 | StringBuilder sb = new StringBuilder(); | ||
120 | |||
121 | List<Thread> threads = ThreadTracker.GetThreads(); | ||
122 | if (threads == null) | ||
123 | { | ||
124 | sb.Append("Thread tracking is only enabled in DEBUG mode."); | ||
125 | } | ||
126 | else | ||
127 | { | ||
128 | sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine); | ||
129 | foreach (Thread t in threads) | ||
130 | { | ||
131 | sb.Append( | ||
132 | "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", Alive: " + t.IsAlive | ||
133 | + ", Pri: " + t.Priority + ", State: " + t.ThreadState + Environment.NewLine); | ||
134 | } | ||
135 | } | ||
136 | |||
137 | return sb.ToString(); | ||
138 | } | ||
113 | 139 | ||
114 | /// <summary> | 140 | /// <summary> |
115 | /// Return a report about the uptime of this server | 141 | /// Return a report about the uptime of this server |
@@ -261,7 +287,7 @@ namespace OpenSim.Framework.Servers | |||
261 | /// Show help information | 287 | /// Show help information |
262 | /// </summary> | 288 | /// </summary> |
263 | /// <param name="helpArgs"></param> | 289 | /// <param name="helpArgs"></param> |
264 | public virtual void ShowHelp(string[] helpArgs) | 290 | protected virtual void ShowHelp(string[] helpArgs) |
265 | { | 291 | { |
266 | if (helpArgs.Length == 0) | 292 | if (helpArgs.Length == 0) |
267 | { | 293 | { |
@@ -283,7 +309,7 @@ namespace OpenSim.Framework.Servers | |||
283 | 309 | ||
284 | return; | 310 | return; |
285 | } | 311 | } |
286 | } | 312 | } |
287 | 313 | ||
288 | /// <summary> | 314 | /// <summary> |
289 | /// Outputs to the console information about the region | 315 | /// Outputs to the console information about the region |
@@ -308,19 +334,7 @@ namespace OpenSim.Framework.Servers | |||
308 | break; | 334 | break; |
309 | 335 | ||
310 | case "threads": | 336 | case "threads": |
311 | List<Thread> threads = ThreadTracker.GetThreads(); | 337 | Notice(GetThreadReport()); |
312 | if (threads == null) | ||
313 | { | ||
314 | Notice("Thread tracking is only enabled in DEBUG mode."); | ||
315 | } | ||
316 | else | ||
317 | { | ||
318 | Notice(threads.Count + " threads are being tracked:"); | ||
319 | foreach (Thread t in threads) | ||
320 | { | ||
321 | Notice("ID: " + t.ManagedThreadId.ToString() + ", Name: " + t.Name + ", Alive: " + t.IsAlive.ToString() + ", Pri: " + t.Priority.ToString() + ", State: " + t.ThreadState.ToString()); | ||
322 | } | ||
323 | } | ||
324 | break; | 338 | break; |
325 | 339 | ||
326 | case "uptime": | 340 | case "uptime": |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 20d0cbf..db38b32 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -248,7 +248,6 @@ namespace OpenSim.Grid.UserServer | |||
248 | break; | 248 | break; |
249 | 249 | ||
250 | case "logoff-user": | 250 | case "logoff-user": |
251 | |||
252 | if (cmdparams.Length >= 3) | 251 | if (cmdparams.Length >= 3) |
253 | { | 252 | { |
254 | string firstname = cmdparams[0]; | 253 | string firstname = cmdparams[0]; |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index fb62504..ce44f99 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -602,7 +602,7 @@ namespace OpenSim | |||
602 | } | 602 | } |
603 | } | 603 | } |
604 | 604 | ||
605 | public override void ShowHelp(string[] helpArgs) | 605 | protected override void ShowHelp(string[] helpArgs) |
606 | { | 606 | { |
607 | base.ShowHelp(helpArgs); | 607 | base.ShowHelp(helpArgs); |
608 | 608 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4a50d92..fc99334 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
58 | 58 | ||
59 | // ~ClientView() | 59 | // ~ClientView() |
60 | // { | 60 | // { |
61 | // m_log.Info("[CLIENTVIEW]: Destructor called"); | 61 | // m_log.Info("[CLIENT]: LLClientView destructor called"); |
62 | // } | 62 | // } |
63 | 63 | ||
64 | /* static variables */ | 64 | /* static variables */ |