* 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
0.6.0-stable
Justin Clarke Casey 2008-05-14 23:09:17 +00:00
parent 1ef37b196c
commit e246d6e515
3 changed files with 42 additions and 13 deletions

View File

@ -42,6 +42,7 @@ namespace OpenSim.Framework.Statistics
private long texturesInCache; private long texturesInCache;
private long assetCacheMemoryUsage; private long assetCacheMemoryUsage;
private long textureCacheMemoryUsage; private long textureCacheMemoryUsage;
private long blockedMissingTextureRequests;
private long inventoryServiceRetrievalFailures; private long inventoryServiceRetrievalFailures;
@ -49,6 +50,14 @@ namespace OpenSim.Framework.Statistics
public long TexturesInCache { get { return texturesInCache; } } public long TexturesInCache { get { return texturesInCache; } }
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
/// <summary>
/// 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).
/// </summary>
public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
/// <summary> /// <summary>
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not /// 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) public void AddTexture(AssetBase image)
{ {
// Tedd: I added null check to avoid exception. Don't know if texturesInCache should ++ anyway?
if (image.Data != null) if (image.Data != null)
{ {
texturesInCache++; texturesInCache++;
// This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
textureCacheMemoryUsage += image.Data.Length; textureCacheMemoryUsage += image.Data.Length;
} }
} }
public void AddBlockedMissingTextureRequest()
{
blockedMissingTextureRequests++;
}
public void AddInventoryServiceRetrievalFailure() public void AddInventoryServiceRetrievalFailure()
{ {
inventoryServiceRetrievalFailures++; inventoryServiceRetrievalFailures++;
@ -116,14 +131,22 @@ namespace OpenSim.Framework.Statistics
public string Report() public string Report()
{ {
StringBuilder sb = new StringBuilder(Environment.NewLine); StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("ASSET CACHE STATISTICS"); sb.Append("ASSET STATISTICS");
sb.Append(Environment.NewLine); sb.Append(Environment.NewLine);
sb.Append( sb.Append(
string.Format( string.Format(
@"Asset cache contains {0,6} assets using {1,10:0.000}K @"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine,
Texture cache contains {2,6} textures using {3,10:0.000}K" + Environment.NewLine, AssetsInCache, AssetCacheMemoryUsage / 1024.0));
AssetsInCache, AssetCacheMemoryUsage / 1024.0,
TexturesInCache, TextureCacheMemoryUsage / 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:0.000}K
Blocked requests for missing textures: {2}" + Environment.NewLine,
TexturesInCache, TextureCacheMemoryUsage / 1024.0,
BlockedMissingTextureRequests));
sb.Append(Environment.NewLine); sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS"); sb.Append("INVENTORY STATISTICS");

View File

@ -31,6 +31,7 @@ using libsecondlife;
using log4net; using log4net;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications.Limit; using OpenSim.Framework.Communications.Limit;
using OpenSim.Framework.Statistics;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
@ -125,10 +126,11 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
{ {
if (missingTextureLimitStrategy.IsFirstRefusal(e.RequestedAssetID)) 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 // Commenting out this message for now as it causes too much noise with other
// debug messages. // debug messages.
// TODO: possibly record this as a statistic in the future
//
// m_log.DebugFormat( // 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", // "[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); // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);

View File

@ -752,17 +752,20 @@
<Reference name="System" localCopy="false"/> <Reference name="System" localCopy="false"/>
<Reference name="System.Xml"/> <Reference name="System.Xml"/>
<Reference name="System.Drawing"/> <Reference name="System.Drawing"/>
<Reference name="System.Runtime.Remoting"/> <Reference name="System.Runtime.Remoting"/>
<Reference name="libsecondlife.dll"/> <Reference name="libsecondlife.dll"/>
<Reference name="Axiom.MathLib.dll"/> <Reference name="Axiom.MathLib.dll"/>
<Reference name="OpenSim.Framework"/> <Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Data" /> <Reference name="OpenSim.Data" />
<Reference name="OpenSim.Framework.Console"/> <Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="OpenSim.Framework.Servers"/> <Reference name="OpenSim.Framework.Servers"/>
<!-- Unit tests --> <Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Tests.Common"/> <Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="nunit.framework.dll"/>
<!-- Unit tests -->
<Reference name="OpenSim.Tests.Common"/>
<Reference name="nunit.framework.dll"/>
<!-- For scripting in funny languages by default --> <!-- For scripting in funny languages by default -->
<Reference name="Microsoft.JScript"/> <Reference name="Microsoft.JScript"/>
<Reference name="XMLRPC.dll"/> <Reference name="XMLRPC.dll"/>
@ -770,6 +773,7 @@
<Reference name="OpenSim.Data.Base"/> <Reference name="OpenSim.Data.Base"/>
<Reference name="Nini.dll" /> <Reference name="Nini.dll" />
<Reference name="log4net"/> <Reference name="log4net"/>
<Files> <Files>
<Match pattern="*.cs" recurse="true"/> <Match pattern="*.cs" recurse="true"/>
</Files> </Files>