diff options
author | Justin Clarke Casey | 2008-02-20 20:23:03 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-02-20 20:23:03 +0000 |
commit | 7d7ad4dff205faf64116defdc25f2d484cd04589 (patch) | |
tree | b7726896da3f01708cb478117b3e908f5d6d269c | |
parent | div+ (diff) | |
download | opensim-SC-7d7ad4dff205faf64116defdc25f2d484cd04589.zip opensim-SC-7d7ad4dff205faf64116defdc25f2d484cd04589.tar.gz opensim-SC-7d7ad4dff205faf64116defdc25f2d484cd04589.tar.bz2 opensim-SC-7d7ad4dff205faf64116defdc25f2d484cd04589.tar.xz |
* 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
5 files changed, 22 insertions, 20 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 0e31e95..5e6bd5f 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -249,6 +249,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
249 | } | 249 | } |
250 | else | 250 | else |
251 | { | 251 | { |
252 | m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); | ||
253 | |||
252 | NewAssetRequest req = new NewAssetRequest(assetId, callback); | 254 | NewAssetRequest req = new NewAssetRequest(assetId, callback); |
253 | 255 | ||
254 | // Make sure we always have a request list to which to add the asset | 256 | // Make sure we always have a request list to which to add the asset |
@@ -265,11 +267,10 @@ namespace OpenSim.Framework.Communications.Cache | |||
265 | } | 267 | } |
266 | } | 268 | } |
267 | 269 | ||
268 | m_log.DebugFormat("[ASSET CACHE]: Added request for {0} {1}", isTexture ? "texture" : "asset", assetId); | ||
269 | requestList.Requests.Add(req); | 270 | requestList.Requests.Add(req); |
270 | 271 | ||
271 | m_assetServer.RequestAsset(assetId, isTexture); | 272 | m_assetServer.RequestAsset(assetId, isTexture); |
272 | } | 273 | } |
273 | } | 274 | } |
274 | 275 | ||
275 | /// <summary> | 276 | /// <summary> |
@@ -383,7 +384,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
383 | } | 384 | } |
384 | } | 385 | } |
385 | 386 | ||
386 | m_log.InfoFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); | 387 | m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); |
387 | } | 388 | } |
388 | 389 | ||
389 | /// <summary> | 390 | /// <summary> |
@@ -411,7 +412,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
411 | // See IAssetReceiver | 412 | // See IAssetReceiver |
412 | public void AssetReceived(AssetBase asset, bool IsTexture) | 413 | public void AssetReceived(AssetBase asset, bool IsTexture) |
413 | { | 414 | { |
414 | m_log.InfoFormat("[ASSET CACHE]: Recieved {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); | 415 | m_log.DebugFormat("[ASSET CACHE]: Recieved {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); |
415 | 416 | ||
416 | if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server | 417 | if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server |
417 | { | 418 | { |
@@ -425,7 +426,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
425 | TextureImage image = new TextureImage(asset); | 426 | TextureImage image = new TextureImage(asset); |
426 | if (Textures.ContainsKey(image.FullID)) | 427 | if (Textures.ContainsKey(image.FullID)) |
427 | { | 428 | { |
428 | m_log.InfoFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID); | 429 | m_log.DebugFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID); |
429 | } | 430 | } |
430 | else | 431 | else |
431 | { | 432 | { |
diff --git a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs index 0473c09..531d4ff 100644 --- a/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/TextureDownloadModule.cs | |||
@@ -13,7 +13,7 @@ | |||
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
@@ -161,7 +161,6 @@ namespace OpenSim.Region.Environment.Modules | |||
161 | if (TryGetUserTextureService(client.AgentId, out textureService)) | 161 | if (TryGetUserTextureService(client.AgentId, out textureService)) |
162 | { | 162 | { |
163 | textureService.HandleTextureRequest(client, e); | 163 | textureService.HandleTextureRequest(client, e); |
164 | m_scene.AddPendingDownloads(1); | ||
165 | } | 164 | } |
166 | } | 165 | } |
167 | 166 | ||
@@ -208,8 +207,9 @@ namespace OpenSim.Region.Environment.Modules | |||
208 | /// <param name="sender"></param> | 207 | /// <param name="sender"></param> |
209 | private void TextureSent(TextureSender sender) | 208 | private void TextureSent(TextureSender sender) |
210 | { | 209 | { |
211 | sender.Sending = false; | 210 | sender.Sending = false; |
212 | m_scene.AddPendingDownloads(-1); | 211 | //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); |
212 | m_scene.AddPendingDownloads(-1); | ||
213 | } | 213 | } |
214 | } | 214 | } |
215 | } | 215 | } |
diff --git a/OpenSim/Region/Environment/Modules/TextureSender.cs b/OpenSim/Region/Environment/Modules/TextureSender.cs index f2b3173..056b8e1 100644 --- a/OpenSim/Region/Environment/Modules/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/TextureSender.cs | |||
@@ -53,6 +53,8 @@ namespace OpenSim.Region.Environment.Modules | |||
53 | /// </summary> | 53 | /// </summary> |
54 | private AssetBase m_asset; | 54 | private AssetBase m_asset; |
55 | 55 | ||
56 | //public LLUUID assetID { get { return m_asset.FullID; } } | ||
57 | |||
56 | /// <summary> | 58 | /// <summary> |
57 | /// This is actually the number of extra packets required to send the texture data! We always assume | 59 | /// This is actually the number of extra packets required to send the texture data! We always assume |
58 | /// at least one is required. | 60 | /// at least one is required. |
diff --git a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs index 2f08bd6..bd5ee0b5 100644 --- a/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/UserTextureDownloadService.cs | |||
@@ -42,8 +42,8 @@ namespace OpenSim.Region.Environment.Modules | |||
42 | /// </summary> | 42 | /// </summary> |
43 | public class UserTextureDownloadService | 43 | public class UserTextureDownloadService |
44 | { | 44 | { |
45 | //private static readonly log4net.ILog m_log | 45 | private static readonly log4net.ILog m_log |
46 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 46 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | /// <summary> | 48 | /// <summary> |
49 | /// Holds texture senders before they have received the appropriate texture from the asset cache. | 49 | /// Holds texture senders before they have received the appropriate texture from the asset cache. |
@@ -81,16 +81,15 @@ namespace OpenSim.Region.Environment.Modules | |||
81 | { | 81 | { |
82 | if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) | 82 | if (m_textureSenders.TryGetValue(e.RequestedAssetID, out textureSender)) |
83 | { | 83 | { |
84 | textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); | 84 | // If we've received new non UUID information for this request and it hasn't dispatched |
85 | 85 | // yet, then update the request accordingly. | |
86 | if ((textureSender.ImageLoaded) && | 86 | textureSender.UpdateRequest(e.DiscardLevel, e.PacketNumber); |
87 | (textureSender.Sending == false)) | ||
88 | { | ||
89 | EnqueueTextureSender(textureSender); | ||
90 | } | ||
91 | } | 87 | } |
92 | else | 88 | else |
93 | { | 89 | { |
90 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Adding download stat {0}", e.RequestedAssetID); | ||
91 | m_scene.AddPendingDownloads(1); | ||
92 | |||
94 | TextureSender requestHandler = | 93 | TextureSender requestHandler = |
95 | new TextureSender(client, e.DiscardLevel, e.PacketNumber); | 94 | new TextureSender(client, e.DiscardLevel, e.PacketNumber); |
96 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); | 95 | m_textureSenders.Add(e.RequestedAssetID, requestHandler); |
@@ -141,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules | |||
141 | // TODO Send packet back to the client telling it not to expect the texture | 140 | // TODO Send packet back to the client telling it not to expect the texture |
142 | // The absence of this packet doesn't appear to be causing it a problem right now | 141 | // The absence of this packet doesn't appear to be causing it a problem right now |
143 | 142 | ||
144 | //m_log.InfoFormat("Removing {0} from pending downloads count", textureID); | 143 | //m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Removing download stat for {0}", textureID); |
145 | m_scene.AddPendingDownloads(-1); | 144 | m_scene.AddPendingDownloads(-1); |
146 | } | 145 | } |
147 | 146 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs index 422189e..90e09b0 100644 --- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs | |||
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
370 | public void addPendingDownload(int count) | 370 | public void addPendingDownload(int count) |
371 | { | 371 | { |
372 | m_pendingDownloads += count; | 372 | m_pendingDownloads += count; |
373 | //m_log.InfoFormat("Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); | 373 | //m_log.InfoFormat("[stats]: Adding {0} to pending downloads to make {1}", count, m_pendingDownloads); |
374 | } | 374 | } |
375 | 375 | ||
376 | public void addScriptLines(int count) | 376 | public void addScriptLines(int count) |