From 4af62865122121069638ed51f3c799a265800a4c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 14 Jun 2008 17:47:25 +0000 Subject: * Start recording asset request failures * This includes problems such as connection failures and timeouts. It does not include 'asset not found' replies from the asset service. --- .../Communications/Cache/AssetServerBase.cs | 8 ++++-- .../Framework/Statistics/SimExtraStatsCollector.cs | 33 ++++++++++++++-------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 053cb0f..74b1976 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -31,6 +31,7 @@ using System.Threading; using libsecondlife; using log4net; using OpenSim.Framework.AssetLoader.Filesystem; +using OpenSim.Framework.Statistics; namespace OpenSim.Framework.Communications.Cache { @@ -80,6 +81,9 @@ namespace OpenSim.Framework.Communications.Cache { m_log.ErrorFormat("[ASSET]: Asset request for {0} threw exception {1}", req.AssetID, e); + if (StatsManager.SimExtraStats != null) + StatsManager.SimExtraStats.AddAssetServiceRequestFailure(); + m_receiver.AssetNotFound(req.AssetID, req.IsTexture); return; @@ -87,13 +91,13 @@ namespace OpenSim.Framework.Communications.Cache if (asset != null) { - m_log.DebugFormat("[ASSET]: Asset {0} received from asset server", req.AssetID); + //m_log.DebugFormat("[ASSET]: Asset {0} received from asset server", req.AssetID); m_receiver.AssetReceived(asset, req.IsTexture); } else { - m_log.WarnFormat("[ASSET]: Asset {0} not found by asset server", req.AssetID); + //m_log.WarnFormat("[ASSET]: Asset {0} not found by asset server", req.AssetID); m_receiver.AssetNotFound(req.AssetID, req.IsTexture); } diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 6c67c9e..968ed3f 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -46,6 +46,7 @@ namespace OpenSim.Framework.Statistics private long textureCacheMemoryUsage; private long blockedMissingTextureRequests; + private long assetServiceRequestFailures; private long inventoryServiceRetrievalFailures; /// @@ -72,6 +73,13 @@ namespace OpenSim.Framework.Statistics public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } } /// + /// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as + /// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted + /// as a failure + /// + public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } } + + /// /// Number of known failures to retrieve avatar inventory from the inventory service. This does not /// cover situations where the inventory service accepts the request but never returns any data, since /// we do not yet timeout this situation. @@ -122,6 +130,11 @@ namespace OpenSim.Framework.Statistics blockedMissingTextureRequests++; } + public void AddAssetServiceRequestFailure() + { + assetServiceRequestFailures++; + } + public void AddInventoryServiceRetrievalFailure() { inventoryServiceRetrievalFailures++; @@ -163,18 +176,14 @@ namespace OpenSim.Framework.Statistics sb.Append(Environment.NewLine); sb.Append( string.Format( -@"Asset cache contains {0,6} assets using {1,10} K" + Environment.NewLine, - AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0))); - - sb.Append(Environment.NewLine); - sb.Append("TEXTURE STATISTICS"); - sb.Append(Environment.NewLine); - sb.Append( - string.Format( -@"Texture cache contains {0,6} textures using {1,10} K -Blocked requests for missing textures: {2}" + Environment.NewLine, - TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), - BlockedMissingTextureRequests)); +@"Asset cache contains {0,6} non-texture assets using {1,10} K +Texture cache contains {2,6} texture assets using {3,10} K +Blocked client requests for missing textures: {4} +Asset service request failures: {5}"+ Environment.NewLine, + AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), + TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), + BlockedMissingTextureRequests, + AssetServiceRequestFailures)); sb.Append(Environment.NewLine); sb.Append("CONNECTION STATISTICS"); -- cgit v1.1