aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetCache.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-01-31 00:42:31 +0000
committerJustin Clarke Casey2008-01-31 00:42:31 +0000
commita4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d (patch)
tree3ca82ca3f5b6f3f03e4d9c26b2dc17a5c6247bf8 /OpenSim/Framework/Communications/Cache/AssetCache.cs
parent* Add 'asset not found' statistics to grid asset server stats (diff)
downloadopensim-SC-a4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d.zip
opensim-SC-a4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d.tar.gz
opensim-SC-a4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d.tar.bz2
opensim-SC-a4bf98f4ba6ecc27d1af0092b6e2a1bac36ed44d.tar.xz
* Add asset/texture cache statistics to region server console
* You can type 'stats' at the REGION# prompt to get this information in grid or standalone mode * Don't take these numbers as gospel yet, since for some reason textures displayed from inventory which require downloading from the server are being recorded as assets rather than textures * But I don't have any reason to believe they aren't broadly accurate. * I've put these in so I can tell whether the high memory usage on regions is down to the asset/texture cache * This will require a prebuild * DEV: Only adds needed to be implemented since, as far as I can tell, assets cached are currently never released. For my part, seeing large cache memory numbers will provoke me to think about doing something about this. * DEV: Now switched to using a singleton to get the stats reporters rather than threading the object through various layers * DEV: Will refactor the other server stats reporters to do this in one of the next commits
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 6d9a0d6..84c549b 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -31,7 +31,9 @@ using System.Collections.Generic;
31using System.Threading; 31using System.Threading;
32using libsecondlife; 32using libsecondlife;
33using libsecondlife.Packets; 33using libsecondlife.Packets;
34
34using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Statistics;
35 37
36namespace OpenSim.Framework.Communications.Cache 38namespace OpenSim.Framework.Communications.Cache
37{ 39{
@@ -220,9 +222,13 @@ namespace OpenSim.Framework.Communications.Cache
220 result = "Duplicate ignored."; 222 result = "Duplicate ignored.";
221 } 223 }
222 else 224 else
223 { 225 {
224 TextureImage textur = new TextureImage(asset); 226 TextureImage textur = new TextureImage(asset);
225 Textures.Add(textur.FullID, textur); 227 Textures.Add(textur.FullID, textur);
228
229 if (StatsManager.SimExtraStats != null)
230 StatsManager.SimExtraStats.AddTexture(textur);
231
226 if (asset.Temporary) 232 if (asset.Temporary)
227 { 233 {
228 result = "Added to cache"; 234 result = "Added to cache";
@@ -244,6 +250,10 @@ namespace OpenSim.Framework.Communications.Cache
244 { 250 {
245 AssetInfo assetInf = new AssetInfo(asset); 251 AssetInfo assetInf = new AssetInfo(asset);
246 Assets.Add(assetInf.FullID, assetInf); 252 Assets.Add(assetInf.FullID, assetInf);
253
254 if (StatsManager.SimExtraStats != null)
255 StatsManager.SimExtraStats.AddAsset(assetInf);
256
247 if (asset.Temporary) 257 if (asset.Temporary)
248 { 258 {
249 result = "Added to cache"; 259 result = "Added to cache";
@@ -292,8 +302,12 @@ namespace OpenSim.Framework.Communications.Cache
292 302
293 TextureImage image = new TextureImage(asset); 303 TextureImage image = new TextureImage(asset);
294 if (!Textures.ContainsKey(image.FullID)) 304 if (!Textures.ContainsKey(image.FullID))
295 { 305 {
296 Textures.Add(image.FullID, image); 306 Textures.Add(image.FullID, image);
307
308 if (StatsManager.SimExtraStats != null)
309 StatsManager.SimExtraStats.AddTexture(image);
310
297 if (RequestedTextures.ContainsKey(image.FullID)) 311 if (RequestedTextures.ContainsKey(image.FullID))
298 { 312 {
299 AssetRequest req = RequestedTextures[image.FullID]; 313 AssetRequest req = RequestedTextures[image.FullID];
@@ -312,6 +326,10 @@ namespace OpenSim.Framework.Communications.Cache
312 if (!Assets.ContainsKey(assetInf.FullID)) 326 if (!Assets.ContainsKey(assetInf.FullID))
313 { 327 {
314 Assets.Add(assetInf.FullID, assetInf); 328 Assets.Add(assetInf.FullID, assetInf);
329
330 if (StatsManager.SimExtraStats != null)
331 StatsManager.SimExtraStats.AddAsset(assetInf);
332
315 if (RequestedAssets.ContainsKey(assetInf.FullID)) 333 if (RequestedAssets.ContainsKey(assetInf.FullID))
316 { 334 {
317 AssetRequest req = RequestedAssets[assetInf.FullID]; 335 AssetRequest req = RequestedAssets[assetInf.FullID];