diff options
author | Justin Clark-Casey (justincc) | 2011-11-15 22:51:12 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-15 22:51:12 +0000 |
commit | 29eb3b2eb57a43e9959486fb371d81a60ccab921 (patch) | |
tree | a54680742edc760f779698d63147eb322c8f9630 | |
parent | send a watchdog heartbeat for a poll worker thread when it's actually run (diff) | |
download | opensim-SC_OLD-29eb3b2eb57a43e9959486fb371d81a60ccab921.zip opensim-SC_OLD-29eb3b2eb57a43e9959486fb371d81a60ccab921.tar.gz opensim-SC_OLD-29eb3b2eb57a43e9959486fb371d81a60ccab921.tar.bz2 opensim-SC_OLD-29eb3b2eb57a43e9959486fb371d81a60ccab921.tar.xz |
improve formatting of "show threads"
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 65d4d32..41a0e4e 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -243,6 +243,9 @@ 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,10} {4,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 | ||
@@ -250,12 +253,16 @@ namespace OpenSim.Framework.Servers | |||
250 | 253 | ||
251 | int timeNow = Util.EnvironmentTickCount(); | 254 | int timeNow = Util.EnvironmentTickCount(); |
252 | 255 | ||
256 | sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "PRIORITY", "STATE"); | ||
257 | sb.Append(Environment.NewLine); | ||
258 | |||
253 | foreach (Watchdog.ThreadWatchdogInfo twi in threads) | 259 | foreach (Watchdog.ThreadWatchdogInfo twi in threads) |
254 | { | 260 | { |
255 | Thread t = twi.Thread; | 261 | Thread t = twi.Thread; |
256 | 262 | ||
257 | sb.AppendFormat( | 263 | sb.AppendFormat( |
258 | "ID: {0}, Name: {1}, Last Update: {2} ms ago, Pri: {3}, State: {4}", | 264 | reportFormat, |
265 | //t.ManagedThreadId, t.Name, string.Format("{0} ms", timeNow - twi.LastTick), t.Priority, t.ThreadState); | ||
259 | t.ManagedThreadId, t.Name, timeNow - twi.LastTick, t.Priority, t.ThreadState); | 266 | t.ManagedThreadId, t.Name, timeNow - twi.LastTick, t.Priority, t.ThreadState); |
260 | 267 | ||
261 | sb.Append(Environment.NewLine); | 268 | sb.Append(Environment.NewLine); |