diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Watchdog.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 15 |
3 files changed, 23 insertions, 15 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 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 55279cc..cb500b9 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -31,7 +31,6 @@ using System.Reflection; | |||
31 | 31 | ||
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | |||
35 | using OpenSim.Region.Framework; | 34 | using OpenSim.Region.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
@@ -44,13 +43,13 @@ using Nini.Config; | |||
44 | 43 | ||
45 | namespace OpenSim.Region.CoreModules.Framework.UserManagement | 44 | namespace OpenSim.Region.CoreModules.Framework.UserManagement |
46 | { | 45 | { |
47 | struct UserData | 46 | class UserData |
48 | { | 47 | { |
49 | public UUID Id; | 48 | public UUID Id { get; set; } |
50 | public string FirstName; | 49 | public string FirstName { get; set; } |
51 | public string LastName; | 50 | public string LastName { get; set; } |
52 | public string HomeURL; | 51 | public string HomeURL { get; set; } |
53 | public Dictionary<string, object> ServerURLs; | 52 | public Dictionary<string, object> ServerURLs { get; set; } |
54 | } | 53 | } |
55 | 54 | ||
56 | public class UserManagementModule : ISharedRegionModule, IUserManagement | 55 | public class UserManagementModule : ISharedRegionModule, IUserManagement |
@@ -253,6 +252,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
253 | 252 | ||
254 | public string GetUserServerURL(UUID userID, string serverType) | 253 | public string GetUserServerURL(UUID userID, string serverType) |
255 | { | 254 | { |
255 | UserData userdata; | ||
256 | lock (m_UserCache) | 256 | lock (m_UserCache) |
257 | m_UserCache.TryGetValue(userID, out userdata); | 257 | m_UserCache.TryGetValue(userID, out userdata); |
258 | 258 | ||
@@ -287,6 +287,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
287 | if (account != null) | 287 | if (account != null) |
288 | return userID.ToString(); | 288 | return userID.ToString(); |
289 | 289 | ||
290 | UserData ud; | ||
290 | lock (m_UserCache) | 291 | lock (m_UserCache) |
291 | m_UserCache.TryGetValue(userID, out ud); | 292 | m_UserCache.TryGetValue(userID, out ud); |
292 | 293 | ||