* Start recording abnormal client thread terminations

0.6.0-stable
Justin Clarke Casey 2008-06-04 16:30:44 +00:00
parent 11246c284f
commit 6e2f3bd3fb
2 changed files with 25 additions and 1 deletions

View File

@ -38,6 +38,8 @@ namespace OpenSim.Framework.Statistics
/// </summary>
public class SimExtraStatsCollector : IStatsCollector
{
private long abnormalClientThreadTerminations;
private long assetsInCache;
private long texturesInCache;
private long assetCacheMemoryUsage;
@ -46,6 +48,11 @@ namespace OpenSim.Framework.Statistics
private long inventoryServiceRetrievalFailures;
/// <summary>
/// Number of times that a client thread terminated because of an exception
/// </summary>
public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } }
public long AssetsInCache { get { return assetsInCache; } }
public long TexturesInCache { get { return texturesInCache; } }
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
@ -72,6 +79,11 @@ namespace OpenSim.Framework.Statistics
private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors
= new Dictionary<LLUUID, PacketQueueStatsCollector>();
public void AddAbnormalClientThreadTermination()
{
abnormalClientThreadTerminations++;
}
public void AddAsset(AssetBase asset)
{
assetsInCache++;
@ -148,6 +160,14 @@ Blocked requests for missing textures: {2}" + Environment.NewLine,
TexturesInCache, TextureCacheMemoryUsage / 1024.0,
BlockedMissingTextureRequests));
sb.Append(Environment.NewLine);
sb.Append("CONNECTION STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
"Abnormal client thread terminations: {0}" + Environment.NewLine,
abnormalClientThreadTerminations));
sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS");
sb.Append(Environment.NewLine);

View File

@ -39,6 +39,7 @@ using libsecondlife.Packets;
using log4net;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Statistics;
using OpenSim.Region.ClientStack.LindenUDP;
using OpenSim.Region.Environment.Scenes;
using Timer=System.Timers.Timer;
@ -729,6 +730,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (e is ThreadAbortException)
throw e;
if (StatsManager.SimExtraStats != null)
StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
// Don't let a failure in an individual client thread crash the whole sim.
// FIXME: could do more sophisticated cleanup since leaving client resources around may
// cause instability for the region server over time.