From e246d6e51588d75230800f4c36ee98867e25df56 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 14 May 2008 23:09:17 +0000
Subject: * Start recording as a statistic the number of times we start
blocking repetitive client requests for the same missing texture * This is to
maintain some visibility on the problem, since I removed the intentionally
irritating log messages for this
---
.../Framework/Statistics/SimExtraStatsCollector.cs | 35 ++++++++++++++++++----
.../TextureDownload/UserTextureDownloadService.cs | 6 ++--
2 files changed, 33 insertions(+), 8 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index 3716f9b..fd021bc 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -42,6 +42,7 @@ namespace OpenSim.Framework.Statistics
private long texturesInCache;
private long assetCacheMemoryUsage;
private long textureCacheMemoryUsage;
+ private long blockedMissingTextureRequests;
private long inventoryServiceRetrievalFailures;
@@ -49,6 +50,14 @@ namespace OpenSim.Framework.Statistics
public long TexturesInCache { get { return texturesInCache; } }
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
+
+ ///
+ /// Number of persistent requests for missing textures we have started blocking from clients. To some extent
+ /// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
+ /// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
+ /// driver bugs on clients (though this seems less likely).
+ ///
+ public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
///
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not
@@ -71,14 +80,20 @@ namespace OpenSim.Framework.Statistics
public void AddTexture(AssetBase image)
{
- // Tedd: I added null check to avoid exception. Don't know if texturesInCache should ++ anyway?
if (image.Data != null)
{
texturesInCache++;
+
+ // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
textureCacheMemoryUsage += image.Data.Length;
}
}
+ public void AddBlockedMissingTextureRequest()
+ {
+ blockedMissingTextureRequests++;
+ }
+
public void AddInventoryServiceRetrievalFailure()
{
inventoryServiceRetrievalFailures++;
@@ -116,14 +131,22 @@ namespace OpenSim.Framework.Statistics
public string Report()
{
StringBuilder sb = new StringBuilder(Environment.NewLine);
- sb.Append("ASSET CACHE STATISTICS");
+ sb.Append("ASSET STATISTICS");
+ sb.Append(Environment.NewLine);
+ sb.Append(
+ string.Format(
+@"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine,
+ AssetsInCache, AssetCacheMemoryUsage / 1024.0));
+
+ sb.Append(Environment.NewLine);
+ sb.Append("TEXTURE STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
-@"Asset cache contains {0,6} assets using {1,10:0.000}K
-Texture cache contains {2,6} textures using {3,10:0.000}K" + Environment.NewLine,
- AssetsInCache, AssetCacheMemoryUsage / 1024.0,
- TexturesInCache, TextureCacheMemoryUsage / 1024.0));
+@"Texture cache contains {0,6} textures using {1,10:0.000}K
+Blocked requests for missing textures: {2}" + Environment.NewLine,
+ TexturesInCache, TextureCacheMemoryUsage / 1024.0,
+ BlockedMissingTextureRequests));
sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS");
diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
index 12ee278..d4fa39f 100644
--- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs
@@ -31,6 +31,7 @@ using libsecondlife;
using log4net;
using OpenSim.Framework;
using OpenSim.Framework.Communications.Limit;
+using OpenSim.Framework.Statistics;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes;
@@ -125,10 +126,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{
if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID))
{
+ if (StatsManager.SimExtraStats != null)
+ StatsManager.SimExtraStats.AddBlockedMissingTextureRequest();
+
// Commenting out this message for now as it causes too much noise with other
// debug messages.
- // TODO: possibly record this as a statistic in the future
- //
// m_log.DebugFormat(
// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
--
cgit v1.1