aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs10
-rw-r--r--OpenSim/Framework/Statistics/SimExtraStatsCollector.cs37
2 files changed, 41 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index dfbdb09..7d06a1e 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -312,18 +312,20 @@ namespace OpenSim.Framework.Communications.Cache
312 { 312 {
313 m_assetServer.StoreAsset(asset); 313 m_assetServer.StoreAsset(asset);
314 } 314 }
315
316 if (StatsManager.SimExtraStats != null)
317 StatsManager.SimExtraStats.AddAsset(asset);
315 } 318 }
316 } 319 }
317 320
318 public void ExpireAsset(UUID uuid) 321 public void ExpireAsset(UUID uuid)
319 { 322 {
320 // uuid is unique, so no need to worry about it showing up
321 // in the 2 caches differently. Also, locks are probably
322 // needed in all of this, or move to synchronized non
323 // generic forms for Dictionaries.
324 if (m_memcache.Contains(uuid)) 323 if (m_memcache.Contains(uuid))
325 { 324 {
326 m_memcache.Remove(uuid); 325 m_memcache.Remove(uuid);
326
327 if (StatsManager.SimExtraStats != null)
328 StatsManager.SimExtraStats.RemoveAsset(uuid);
327 } 329 }
328 } 330 }
329 331
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
index ce654eb..d6e26e4 100644
--- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs
@@ -80,11 +80,23 @@ namespace OpenSim.Framework.Statistics
80 /// <summary> 80 /// <summary>
81 /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the 81 /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
82 /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these 82 /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
83 /// haven't yet been implemented... :) 83 /// haven't yet been implemented...
84 /// </summary> 84 /// </summary>
85 public long AssetsInCache { get { return assetsInCache; } } 85 public long AssetsInCache { get { return assetsInCache; } }
86
87 /// <value>
88 /// Currently unused
89 /// </value>
86 public long TexturesInCache { get { return texturesInCache; } } 90 public long TexturesInCache { get { return texturesInCache; } }
91
92 /// <value>
93 /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
94 /// </value>
87 public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } 95 public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
96
97 /// <value>
98 /// Currently unused
99 /// </value>
88 public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } 100 public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
89 101
90 public float TimeDilation { get { return timeDilation; } } 102 public float TimeDilation { get { return timeDilation; } }
@@ -108,6 +120,7 @@ namespace OpenSim.Framework.Statistics
108 public float PendingUploads { get { return pendingUploads; } } 120 public float PendingUploads { get { return pendingUploads; } }
109 public float ActiveScripts { get { return activeScripts; } } 121 public float ActiveScripts { get { return activeScripts; } }
110 public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } } 122 public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } }
123
111 /// <summary> 124 /// <summary>
112 /// This is the time it took for the last asset request made in response to a cache miss. 125 /// This is the time it took for the last asset request made in response to a cache miss.
113 /// </summary> 126 /// </summary>
@@ -159,7 +172,12 @@ namespace OpenSim.Framework.Statistics
159 public void AddAsset(AssetBase asset) 172 public void AddAsset(AssetBase asset)
160 { 173 {
161 assetsInCache++; 174 assetsInCache++;
162 assetCacheMemoryUsage += asset.Data.Length; 175 //assetCacheMemoryUsage += asset.Data.Length;
176 }
177
178 public void RemoveAsset(UUID uuid)
179 {
180 assetsInCache--;
163 } 181 }
164 182
165 public void AddTexture(AssetBase image) 183 public void AddTexture(AssetBase image)
@@ -272,6 +290,8 @@ namespace OpenSim.Framework.Statistics
272 StringBuilder sb = new StringBuilder(Environment.NewLine); 290 StringBuilder sb = new StringBuilder(Environment.NewLine);
273 sb.Append("ASSET STATISTICS"); 291 sb.Append("ASSET STATISTICS");
274 sb.Append(Environment.NewLine); 292 sb.Append(Environment.NewLine);
293
294 /*
275 sb.Append( 295 sb.Append(
276 string.Format( 296 string.Format(
277@"Asset cache contains {0,6} non-texture assets using {1,10} K 297@"Asset cache contains {0,6} non-texture assets using {1,10} K
@@ -284,6 +304,19 @@ Asset service request failures: {6}"+ Environment.NewLine,
284 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0, 304 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0,
285 BlockedMissingTextureRequests, 305 BlockedMissingTextureRequests,
286 AssetServiceRequestFailures)); 306 AssetServiceRequestFailures));
307 */
308
309 sb.Append(
310 string.Format(
311@"Asset cache contains {0,6} assets
312Latest asset request time after cache miss: {1}s
313Blocked client requests for missing textures: {2}
314Asset service request failures: {3}" + Environment.NewLine,
315 AssetsInCache,
316 assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0,
317 BlockedMissingTextureRequests,
318 AssetServiceRequestFailures));
319
287 320
288 sb.Append(Environment.NewLine); 321 sb.Append(Environment.NewLine);
289 sb.Append("CONNECTION STATISTICS"); 322 sb.Append("CONNECTION STATISTICS");