diff options
author | Justin Clarke Casey | 2008-09-21 20:29:06 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-21 20:29:06 +0000 |
commit | 8fb3523ef74f87995a4c791212e7dbefe8134a61 (patch) | |
tree | 2c321c152732d5169b46efbeb134f49dad80c654 /OpenSim | |
parent | * Eliminate the need to copy asset request lists in the asset cache when an a... (diff) | |
download | opensim-SC-8fb3523ef74f87995a4c791212e7dbefe8134a61.zip opensim-SC-8fb3523ef74f87995a4c791212e7dbefe8134a61.tar.gz opensim-SC-8fb3523ef74f87995a4c791212e7dbefe8134a61.tar.bz2 opensim-SC-8fb3523ef74f87995a4c791212e7dbefe8134a61.tar.xz |
* Start recording asset request times after a cache miss. This is very primtive at the moment - only the last time is kept for some classes of request
* This can be seen as "Latest asset request time after cache miss" in show stats on the region console
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 20 | ||||
-rw-r--r-- | OpenSim/Framework/Statistics/SimExtraStatsCollector.cs | 19 |
2 files changed, 33 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 0112198..9c73587 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -252,7 +252,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
252 | else | 252 | else |
253 | { | 253 | { |
254 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); | 254 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); |
255 | 255 | ||
256 | NewAssetRequest req = new NewAssetRequest(assetId, callback); | 256 | NewAssetRequest req = new NewAssetRequest(assetId, callback); |
257 | AssetRequestsList requestList; | 257 | AssetRequestsList requestList; |
258 | 258 | ||
@@ -268,8 +268,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
268 | { | 268 | { |
269 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); | 269 | // m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); |
270 | requestList = new AssetRequestsList(assetId); | 270 | requestList = new AssetRequestsList(assetId); |
271 | RequestLists.Add(assetId, requestList); | 271 | requestList.TimeRequested = DateTime.Now; |
272 | requestList.Requests.Add(req); | 272 | requestList.Requests.Add(req); |
273 | |||
274 | RequestLists.Add(assetId, requestList); | ||
275 | |||
273 | m_assetServer.RequestAsset(assetId, isTexture); | 276 | m_assetServer.RequestAsset(assetId, isTexture); |
274 | } | 277 | } |
275 | } | 278 | } |
@@ -446,6 +449,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
446 | 449 | ||
447 | if (reqList != null) | 450 | if (reqList != null) |
448 | { | 451 | { |
452 | if (StatsManager.SimExtraStats != null) | ||
453 | StatsManager.SimExtraStats.AddAssetRequestTimeAfterCacheMiss(DateTime.Now - reqList.TimeRequested); | ||
454 | |||
449 | foreach (NewAssetRequest req in reqList.Requests) | 455 | foreach (NewAssetRequest req in reqList.Requests) |
450 | { | 456 | { |
451 | // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked | 457 | // Xantor 20080526 are we really calling all the callbacks if multiple queued for 1 request? -- Yes, checked |
@@ -479,6 +485,9 @@ namespace OpenSim.Framework.Communications.Cache | |||
479 | 485 | ||
480 | if (reqList != null) | 486 | if (reqList != null) |
481 | { | 487 | { |
488 | if (StatsManager.SimExtraStats != null) | ||
489 | StatsManager.SimExtraStats.AddAssetRequestTimeAfterCacheMiss(DateTime.Now - reqList.TimeRequested); | ||
490 | |||
482 | foreach (NewAssetRequest req in reqList.Requests) | 491 | foreach (NewAssetRequest req in reqList.Requests) |
483 | { | 492 | { |
484 | req.Callback(assetID, null); | 493 | req.Callback(assetID, null); |
@@ -670,6 +679,11 @@ namespace OpenSim.Framework.Communications.Cache | |||
670 | { | 679 | { |
671 | public UUID AssetID; | 680 | public UUID AssetID; |
672 | public List<NewAssetRequest> Requests = new List<NewAssetRequest>(); | 681 | public List<NewAssetRequest> Requests = new List<NewAssetRequest>(); |
682 | |||
683 | /// <summary> | ||
684 | /// Record the time that this request was first made. | ||
685 | /// </summary> | ||
686 | public DateTime TimeRequested; | ||
673 | 687 | ||
674 | public AssetRequestsList(UUID assetID) | 688 | public AssetRequestsList(UUID assetID) |
675 | { | 689 | { |
diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index cc64ed6..2f6bb7e 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Framework.Statistics | |||
45 | private long texturesInCache; | 45 | private long texturesInCache; |
46 | private long assetCacheMemoryUsage; | 46 | private long assetCacheMemoryUsage; |
47 | private long textureCacheMemoryUsage; | 47 | private long textureCacheMemoryUsage; |
48 | private TimeSpan assetRequestTimeAfterCacheMiss; | ||
48 | private long blockedMissingTextureRequests; | 49 | private long blockedMissingTextureRequests; |
49 | 50 | ||
50 | private long assetServiceRequestFailures; | 51 | private long assetServiceRequestFailures; |
@@ -86,6 +87,11 @@ namespace OpenSim.Framework.Statistics | |||
86 | public long TexturesInCache { get { return texturesInCache; } } | 87 | public long TexturesInCache { get { return texturesInCache; } } |
87 | public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } | 88 | public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } } |
88 | public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } | 89 | public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } } |
90 | |||
91 | /// <summary> | ||
92 | /// This is the time it took for the last asset request made in response to a cache miss. | ||
93 | /// </summary> | ||
94 | public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } } | ||
89 | 95 | ||
90 | /// <summary> | 96 | /// <summary> |
91 | /// Number of persistent requests for missing textures we have started blocking from clients. To some extent | 97 | /// Number of persistent requests for missing textures we have started blocking from clients. To some extent |
@@ -148,7 +154,7 @@ namespace OpenSim.Framework.Statistics | |||
148 | } | 154 | } |
149 | 155 | ||
150 | /// <summary> | 156 | /// <summary> |
151 | /// Signal that the asset cache can be cleared. | 157 | /// Signal that the asset cache has been cleared. |
152 | /// </summary> | 158 | /// </summary> |
153 | public void ClearAssetCacheStatistics() | 159 | public void ClearAssetCacheStatistics() |
154 | { | 160 | { |
@@ -157,6 +163,11 @@ namespace OpenSim.Framework.Statistics | |||
157 | texturesInCache = 0; | 163 | texturesInCache = 0; |
158 | textureCacheMemoryUsage = 0; | 164 | textureCacheMemoryUsage = 0; |
159 | } | 165 | } |
166 | |||
167 | public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts) | ||
168 | { | ||
169 | assetRequestTimeAfterCacheMiss = ts; | ||
170 | } | ||
160 | 171 | ||
161 | public void AddBlockedMissingTextureRequest() | 172 | public void AddBlockedMissingTextureRequest() |
162 | { | 173 | { |
@@ -245,10 +256,12 @@ namespace OpenSim.Framework.Statistics | |||
245 | string.Format( | 256 | string.Format( |
246 | @"Asset cache contains {0,6} non-texture assets using {1,10} K | 257 | @"Asset cache contains {0,6} non-texture assets using {1,10} K |
247 | Texture cache contains {2,6} texture assets using {3,10} K | 258 | Texture cache contains {2,6} texture assets using {3,10} K |
248 | Blocked client requests for missing textures: {4} | 259 | Latest asset request time after cache miss: {4}s |
249 | Asset service request failures: {5}"+ Environment.NewLine, | 260 | Blocked client requests for missing textures: {5} |
261 | Asset service request failures: {6}"+ Environment.NewLine, | ||
250 | AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), | 262 | AssetsInCache, Math.Round(AssetCacheMemoryUsage / 1024.0), |
251 | TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), | 263 | TexturesInCache, Math.Round(TextureCacheMemoryUsage / 1024.0), |
264 | assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0, | ||
252 | BlockedMissingTextureRequests, | 265 | BlockedMissingTextureRequests, |
253 | AssetServiceRequestFailures)); | 266 | AssetServiceRequestFailures)); |
254 | 267 | ||