* Only count download requests for assets which are not already waiting for data from the asset server

* This should stop the constant increase in the download requests statistics
* If you see stat numbers for download requests which are far from what you'd expect, please report
ThreadPoolClientBranch
Justin Clarke Casey 2008-02-20 20:23:03 +00:00
parent 684059afdf
commit 7d7ad4dff2
5 changed files with 22 additions and 20 deletions

View File

@ -249,6 +249,8 @@ namespace OpenSim.Framework.Communications.Cache
} }
else else
{ {
m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId);
NewAssetRequest req = new NewAssetRequest(assetId, callback); NewAssetRequest req = new NewAssetRequest(assetId, callback);
// Make sure we always have a request list to which to add the asset // Make sure we always have a request list to which to add the asset
@ -265,11 +267,10 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
m_log.DebugFormat("[ASSET CACHE]: Added request for {0} {1}", isTexture ? "texture" : "asset", assetId);
requestList.Requests.Add(req); requestList.Requests.Add(req);
m_assetServer.RequestAsset(assetId, isTexture); m_assetServer.RequestAsset(assetId, isTexture);
} }
} }
/// <summary> /// <summary>
@ -383,7 +384,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
m_log.InfoFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result);
} }
/// <summary> /// <summary>
@ -411,7 +412,7 @@ namespace OpenSim.Framework.Communications.Cache
// See IAssetReceiver // See IAssetReceiver
public void AssetReceived(AssetBase asset, bool IsTexture) public void AssetReceived(AssetBase asset, bool IsTexture)
{ {
m_log.InfoFormat("[ASSET CACHE]: Recieved {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); m_log.DebugFormat("[ASSET CACHE]: Recieved {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID);
if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server
{ {
@ -425,7 +426,7 @@ namespace OpenSim.Framework.Communications.Cache
TextureImage image = new TextureImage(asset); TextureImage image = new TextureImage(asset);
if (Textures.ContainsKey(image.FullID)) if (Textures.ContainsKey(image.FullID))
{ {
m_log.InfoFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID); m_log.DebugFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID);
} }
else else
{ {

View File

@ -13,7 +13,7 @@
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@ -161,7 +161,6 @@ namespace OpenSim.Region.Environment.Modules
if (TryGetUserTextureService(client.AgentId, out textureService)) if (TryGetUserTextureService(client.AgentId, out textureService))
{ {
textureService.HandleTextureRequest(client, e); textureService.HandleTextureRequest(client, e);
m_scene.AddPendingDownloads(1);
} }
} }
@ -208,8 +207,9 @@ namespace OpenSim.Region.Environment.Modules
/// <param name="sender"></param> /// <param name="sender"></param>
private void TextureSent(TextureSender sender) private void TextureSent(TextureSender sender)
{ {
sender.Sending = false; sender.Sending = false;
m_scene.AddPendingDownloads(-1); //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID);
m_scene.AddPendingDownloads(-1);
} }
} }
} }

View File

@ -53,6 +53,8 @@ namespace OpenSim.Region.Environment.Modules
/// </summary> /// </summary>
private AssetBase m_asset; private AssetBase m_asset;
//public LLUUID assetID { get { return m_asset.FullID; } }
/// <summary> /// <summary>
/// This is actually the number of extra packets required to send the texture data! We always assume /// This is actually the number of extra packets required to send the texture data! We always assume
/// at least one is required. /// at least one is required.

View File

@ -42,8 +42,8 @@ namespace OpenSim.Region.Environment.Modules
/// </summary> /// </summary>
public class UserTextureDownloadService public class UserTextureDownloadService
{ {
//private static readonly log4net.ILog m_log private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// Holds texture senders before they have received the appropriate texture from the asset cache. /// Holds texture senders before they have received the appropriate texture from the asset cache.
@ -81,16 +81,15 @@ namespace OpenSim.Region.Environment.Modules
{ {
if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender))
{ {
textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); // If we've received new non UUID information for this request and it hasn't dispatched
// yet, then update the request accordingly.
if ((textureSender.ImageLoaded) && textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber);
(textureSender.Sending == false))
{
EnqueueTextureSender(textureSender);
}
} }
else else
{ {
//m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Adding download stat {0}", e.RequestedAssetID);
m_scene.AddPendingDownloads(1);
TextureSender requestHandler = TextureSender requestHandler =
new TextureSender(client, e.DiscardLevel, e.PacketNumber); new TextureSender(client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler); m_textureSenders.Add(e.RequestedAssetID, requestHandler);
@ -141,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules
// TODO Send packet back to the client telling it not to expect the texture // TODO Send packet back to the client telling it not to expect the texture
// The absence of this packet doesn't appear to be causing it a problem right now // The absence of this packet doesn't appear to be causing it a problem right now
//m_log.InfoFormat("Removing {0} from pending downloads count", textureID); //m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Removing download stat for {0}", textureID);
m_scene.AddPendingDownloads(-1); m_scene.AddPendingDownloads(-1);
} }

View File

@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
public void addPendingDownload(int count) public void addPendingDownload(int count)
{ {
m_pendingDownloads += count; m_pendingDownloads += count;
//m_log.InfoFormat("Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads);
} }
public void addScriptLines(int count) public void addScriptLines(int count)