From aea547cd11e4baa24cad12e13160e5ff2250a69f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 15 Nov 2011 23:24:51 +0000 Subject: fix build break on UserManagementModule. This also adds time since started to "show threads". Unfortunately these two changes got mixed in. --- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 ++++++++---- OpenSim/Framework/Watchdog.cs | 11 +++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework') 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 protected string GetThreadsReport() { // This should be a constant field. - string reportFormat = "{0,6} {1,35} {2,16} {3,10} {4,30}"; + string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}"; StringBuilder sb = new StringBuilder(); Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads(); @@ -253,7 +253,7 @@ namespace OpenSim.Framework.Servers int timeNow = Util.EnvironmentTickCount(); - sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "PRIORITY", "STATE"); + sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "LIFETIME (MS)", "PRIORITY", "STATE"); sb.Append(Environment.NewLine); foreach (Watchdog.ThreadWatchdogInfo twi in threads) @@ -262,8 +262,12 @@ namespace OpenSim.Framework.Servers sb.AppendFormat( reportFormat, - //t.ManagedThreadId, t.Name, string.Format("{0} ms", timeNow - twi.LastTick), t.Priority, t.ThreadState); - t.ManagedThreadId, t.Name, timeNow - twi.LastTick, t.Priority, t.ThreadState); + t.ManagedThreadId, + t.Name, + timeNow - twi.LastTick, + timeNow - twi.FirstTick, + t.Priority, + t.ThreadState); sb.Append(Environment.NewLine); } 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 /// /// Approximate tick when this thread was started. /// - public int StartTick { get; private set; } + /// + /// Not terribly good since this quickly wraps around. + /// + public int FirstTick { get; private set; } /// - /// Last time this heartbeat update was invoked + /// First time this heartbeat update was invoked /// public int LastTick { get; set; } @@ -73,8 +76,8 @@ namespace OpenSim.Framework { Thread = thread; Timeout = timeout; - StartTick = Environment.TickCount & Int32.MaxValue; - LastTick = StartTick; + FirstTick = Environment.TickCount & Int32.MaxValue; + LastTick = FirstTick; } } -- cgit v1.1