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/Framework/Communications/Cache | |
parent | * Eliminate the need to copy asset request lists in the asset cache when an a... (diff) | |
download | opensim-SC_OLD-8fb3523ef74f87995a4c791212e7dbefe8134a61.zip opensim-SC_OLD-8fb3523ef74f87995a4c791212e7dbefe8134a61.tar.gz opensim-SC_OLD-8fb3523ef74f87995a4c791212e7dbefe8134a61.tar.bz2 opensim-SC_OLD-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/Framework/Communications/Cache')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 20 |
1 files changed, 17 insertions, 3 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 | { |