diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-04-26 12:39:14 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-04-26 12:39:14 -0400 |
commit | b7b8d6e1aedeac1dfdfcc9200024bbcc8e2dacae (patch) | |
tree | c6d65c1319d9fd5a80473d0c2cd8e528e916af68 /indra/newview/llviewerassetstorage.cpp | |
parent | e6f53dedb704c92af45ede2d97c559cb6639358f (diff) |
MAINT-7343 - added periodic logging of state of the asset store.
Diffstat (limited to 'indra/newview/llviewerassetstorage.cpp')
-rw-r--r-- | indra/newview/llviewerassetstorage.cpp | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 6523b89d7f..9918d226c2 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -99,17 +99,30 @@ public: /// LLViewerAssetStorage ///---------------------------------------------------------------------------- +// Unused? LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs, const LLHost &upstream_host) - : LLAssetStorage(msg, xfer, vfs, static_vfs, upstream_host) + : LLAssetStorage(msg, xfer, vfs, static_vfs, upstream_host), + mAssetCoroCount(0), + mCountRequests(0), + mCountStarted(0), + mCountCompleted(0), + mCountSucceeded(0), + mTotalBytesFetched(0) { } LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, LLVFS *vfs, LLVFS *static_vfs) - : LLAssetStorage(msg, xfer, vfs, static_vfs) + : LLAssetStorage(msg, xfer, vfs, static_vfs), + mAssetCoroCount(0), + mCountRequests(0), + mCountStarted(0), + mCountCompleted(0), + mCountSucceeded(0), + mTotalBytesFetched(0) { } @@ -351,6 +364,7 @@ void LLViewerAssetStorage::_queueDataRequest( BOOL duplicate, BOOL is_priority) { + mCountRequests++; queueRequestHttp(uuid, atype, callback, user_data, duplicate, is_priority); } @@ -404,6 +418,20 @@ void LLViewerAssetStorage::capsRecvForRegion(const LLUUID& region_id, std::strin LLEventPumps::instance().obtain(pumpname).post(LLSD()); } +struct LLScopedIncrement +{ + LLScopedIncrement(S32& counter): + mCounter(counter) + { + ++mCounter; + } + ~LLScopedIncrement() + { + --mCounter; + } + S32& mCounter; +}; + void LLViewerAssetStorage::assetRequestCoro( LLViewerAssetRequest *req, const LLUUID& uuid, @@ -411,6 +439,9 @@ void LLViewerAssetStorage::assetRequestCoro( LLGetAssetCallback callback, void *user_data) { + LLScopedIncrement coro_count_boost(mAssetCoroCount); + mCountStarted++; + S32 result_code = LL_ERR_NOERR; LLExtStat ext_status = LL_EXSTAT_NONE; @@ -463,6 +494,8 @@ void LLViewerAssetStorage::assetRequestCoro( // Bail out if result arrives after shutdown has been started. return; } + + mCountCompleted++; LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -481,6 +514,8 @@ void LLViewerAssetStorage::assetRequestCoro( S32 size = raw.size(); if (size > 0) { + mTotalBytesFetched += size; + // This create-then-rename flow is modeled on // LLTransferTargetVFile, which is what was used in the UDP // case. @@ -502,6 +537,7 @@ void LLViewerAssetStorage::assetRequestCoro( result_code = LL_ERR_ASSET_REQUEST_FAILED; ext_status = LL_EXSTAT_VFS_CORRUPT; } + mCountSucceeded++; } else { @@ -522,3 +558,14 @@ std::string LLViewerAssetStorage::getAssetURL(const std::string& cap_url, const std::string url = cap_url + "/?" + type_name + "_id=" + uuid.asString(); return url; } + +void LLViewerAssetStorage::logAssetStorageInfo() +{ + LLMemory::logMemoryInfo(true); + LL_INFOS("AssetStorage") << "Active coros " << mAssetCoroCount << LL_ENDL; + LL_INFOS("AssetStorage") << "mPendingDownloads size " << mPendingDownloads.size() << LL_ENDL; + LL_INFOS("AssetStorage") << "mCountStarted " << mCountStarted << LL_ENDL; + LL_INFOS("AssetStorage") << "mCountCompleted " << mCountCompleted << LL_ENDL; + LL_INFOS("AssetStorage") << "mCountSucceeded " << mCountSucceeded << LL_ENDL; + LL_INFOS("AssetStorage") << "mTotalBytesFetched " << mTotalBytesFetched << LL_ENDL; +} |