aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-15 23:24:51 +0000
committerJustin Clark-Casey (justincc)2011-11-15 23:24:51 +0000
commitaea547cd11e4baa24cad12e13160e5ff2250a69f (patch)
tree952386c40f3c794e1a7dea8d7c8a6564f941e618 /OpenSim/Framework
parentDo proper locking of UserManagementModule.m_UserCache when getting. (diff)
downloadopensim-SC_OLD-aea547cd11e4baa24cad12e13160e5ff2250a69f.zip
opensim-SC_OLD-aea547cd11e4baa24cad12e13160e5ff2250a69f.tar.gz
opensim-SC_OLD-aea547cd11e4baa24cad12e13160e5ff2250a69f.tar.bz2
opensim-SC_OLD-aea547cd11e4baa24cad12e13160e5ff2250a69f.tar.xz
fix build break on UserManagementModule.
This also adds time since started to "show threads". Unfortunately these two changes got mixed in.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs12
-rw-r--r--OpenSim/Framework/Watchdog.cs11
2 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 41a0e4e..db063f1 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -244,7 +244,7 @@ namespace OpenSim.Framework.Servers
244 protected string GetThreadsReport() 244 protected string GetThreadsReport()
245 { 245 {
246 // This should be a constant field. 246 // This should be a constant field.
247 string reportFormat = "{0,6} {1,35} {2,16} {3,10} {4,30}"; 247 string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
248 248
249 StringBuilder sb = new StringBuilder(); 249 StringBuilder sb = new StringBuilder();
250 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads(); 250 Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
@@ -253,7 +253,7 @@ namespace OpenSim.Framework.Servers
253 253
254 int timeNow = Util.EnvironmentTickCount(); 254 int timeNow = Util.EnvironmentTickCount();
255 255
256 sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "PRIORITY", "STATE"); 256 sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "LIFETIME (MS)", "PRIORITY", "STATE");
257 sb.Append(Environment.NewLine); 257 sb.Append(Environment.NewLine);
258 258
259 foreach (Watchdog.ThreadWatchdogInfo twi in threads) 259 foreach (Watchdog.ThreadWatchdogInfo twi in threads)
@@ -262,8 +262,12 @@ namespace OpenSim.Framework.Servers
262 262
263 sb.AppendFormat( 263 sb.AppendFormat(
264 reportFormat, 264 reportFormat,
265 //t.ManagedThreadId, t.Name, string.Format("{0} ms", timeNow - twi.LastTick), t.Priority, t.ThreadState); 265 t.ManagedThreadId,
266 t.ManagedThreadId, t.Name, timeNow - twi.LastTick, t.Priority, t.ThreadState); 266 t.Name,
267 timeNow - twi.LastTick,
268 timeNow - twi.FirstTick,
269 t.Priority,
270 t.ThreadState);
267 271
268 sb.Append(Environment.NewLine); 272 sb.Append(Environment.NewLine);
269 } 273 }
diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs
index 0ee0c5b..2dd6ebe 100644
--- a/OpenSim/Framework/Watchdog.cs
+++ b/OpenSim/Framework/Watchdog.cs
@@ -52,10 +52,13 @@ namespace OpenSim.Framework
52 /// <summary> 52 /// <summary>
53 /// Approximate tick when this thread was started. 53 /// Approximate tick when this thread was started.
54 /// </summary> 54 /// </summary>
55 public int StartTick { get; private set; } 55 /// <remarks>
56 /// Not terribly good since this quickly wraps around.
57 /// </remarks>
58 public int FirstTick { get; private set; }
56 59
57 /// <summary> 60 /// <summary>
58 /// Last time this heartbeat update was invoked 61 /// First time this heartbeat update was invoked
59 /// </summary> 62 /// </summary>
60 public int LastTick { get; set; } 63 public int LastTick { get; set; }
61 64
@@ -73,8 +76,8 @@ namespace OpenSim.Framework
73 { 76 {
74 Thread = thread; 77 Thread = thread;
75 Timeout = timeout; 78 Timeout = timeout;
76 StartTick = Environment.TickCount & Int32.MaxValue; 79 FirstTick = Environment.TickCount & Int32.MaxValue;
77 LastTick = StartTick; 80 LastTick = FirstTick;
78 } 81 }
79 } 82 }
80 83