diff options
author | Don Kjer <don@lindenlab.com> | 2010-12-13 16:15:25 -0800 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2010-12-13 16:15:25 -0800 |
commit | b71b9ee08e0b59274346a3b4da2c33ff84a5eb90 (patch) | |
tree | d22655a83062300289f60185322fc29e61781879 | |
parent | 9a322d1b7a6ee5380f8724b33a20c56c9583f093 (diff) |
Added object update cache results to viewer stats recorder
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llviewerregion.h | 10 | ||||
-rw-r--r-- | indra/newview/llviewerstatsrecorder.cpp | 44 | ||||
-rw-r--r-- | indra/newview/llviewerstatsrecorder.h | 6 |
5 files changed, 72 insertions, 9 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 249799bf55..64949ecc44 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -500,7 +500,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { if (update_type == OUT_TERSE_IMPROVED) { - // llinfos << "terse update for an unknown object:" << fullid << llendl; + llinfos << "terse update for an unknown object (compressed):" << fullid << llendl; #if LL_RECORD_VIEWER_STATS LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type); #endif @@ -514,7 +514,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { if (update_type != OUT_FULL) { - // llinfos << "terse update for an unknown object:" << fullid << llendl; + llinfos << "terse update for an unknown object:" << fullid << llendl; #if LL_RECORD_VIEWER_STATS LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type); #endif @@ -527,7 +527,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (mDeadObjects.find(fullid) != mDeadObjects.end()) { mNumDeadObjectUpdates++; - // llinfos << "update for a dead object:" << fullid << llendl; + llinfos << "update for a dead object:" << fullid << llendl; #if LL_RECORD_VIEWER_STATS LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type); #endif @@ -538,6 +538,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, objectp = createObject(pcode, regionp, fullid, local_id, gMessageSystem->getSender()); if (!objectp) { + llinfos << "createObject failure for object: " << fullid << llendl; #if LL_RECORD_VIEWER_STATS LLViewerStatsRecorder::instance()->recordObjectUpdateFailure(local_id, update_type); #endif @@ -562,7 +563,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, processUpdateCore(objectp, user_data, i, update_type, &compressed_dp, justCreated); if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only? { - objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp); + LLViewerRegion::eCacheUpdateResult result = objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp); + #if LL_RECORD_VIEWER_STATS + LLViewerStatsRecorder::instance()->recordCacheFullUpdate(local_id, update_type, result, objectp); + #endif } } else if (cached) // Cache hit only? diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index da2373c39d..ea6f1ab342 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1033,7 +1033,7 @@ void LLViewerRegion::getInfo(LLSD& info) info["Region"]["Handle"]["y"] = (LLSD::Integer)y; } -void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp) +LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp) { U32 local_id = objectp->getLocalID(); U32 crc = objectp->getCRC(); @@ -1047,6 +1047,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary { // Record a hit entry->recordDupe(); + return CACHE_UPDATE_DUPE; } else { @@ -1055,6 +1056,7 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary delete entry; entry = new LLVOCacheEntry(local_id, crc, dp); mCacheMap[local_id] = entry; + return CACHE_UPDATE_CHANGED; } } else @@ -1062,15 +1064,18 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary // we haven't seen this object before // Create new entry and add to map + eCacheUpdateResult result = CACHE_UPDATE_ADDED; if (mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES) { mCacheMap.erase(mCacheMap.begin()); + result = CACHE_UPDATE_REPLACED; + } entry = new LLVOCacheEntry(local_id, crc, dp); mCacheMap[local_id] = entry; + return result; } - return ; } // Get data packer for this object, if we have cached data diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 7fac2020ee..5e17f3352d 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -281,8 +281,16 @@ public: CACHE_MISS_TYPE_NONE } eCacheMissType; + typedef enum + { + CACHE_UPDATE_DUPE = 0, + CACHE_UPDATE_CHANGED, + CACHE_UPDATE_ADDED, + CACHE_UPDATE_REPLACED + } eCacheUpdateResult; + // handle a full update message - void cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); + eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); LLDataPacker *getDP(U32 local_id, U32 crc, U8 &cache_miss_type); void requestCacheMisses(); void addCacheMissFull(const U32 local_id); diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index 27bbc17b36..b6ef260b6a 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -96,6 +96,10 @@ void LLViewerStatsRecorder::initStatsRecorder(LLViewerRegion *regionp) << "TerseUpdates, " << "CacheMissRequests, " << "CacheMissResponses, " + << "CacheUpdateDupes, " + << "CacheUpdateChanges, " + << "CacheUpdateAdds, " + << "CacheUpdateReplacements, " << "UpdateFailures" << "\n"; @@ -121,6 +125,10 @@ void LLViewerStatsRecorder::clearStats() mObjectTerseUpdates = 0; mObjectCacheMissRequests = 0; mObjectCacheMissResponses = 0; + mObjectCacheUpdateDupes = 0; + mObjectCacheUpdateChanges = 0; + mObjectCacheUpdateAdds = 0; + mObjectCacheUpdateReplacements = 0; mObjectUpdateFailures = 0; } @@ -156,9 +164,33 @@ void LLViewerStatsRecorder::recordObjectUpdateEvent(U32 local_id, const EObjectU mObjectCacheMissResponses++; break; case OUT_FULL_CACHED: - default: mObjectCacheHitCount++; break; + default: + llwarns << "Unknown update_type" << llendl; + break; + }; +} + +void LLViewerStatsRecorder::recordCacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp) +{ + switch (update_result) + { + case LLViewerRegion::CACHE_UPDATE_DUPE: + mObjectCacheUpdateDupes++; + break; + case LLViewerRegion::CACHE_UPDATE_CHANGED: + mObjectCacheUpdateChanges++; + break; + case LLViewerRegion::CACHE_UPDATE_ADDED: + mObjectCacheUpdateAdds++; + break; + case LLViewerRegion::CACHE_UPDATE_REPLACED: + mObjectCacheUpdateReplacements++; + break; + default: + llwarns << "Unknown update_result type" << llendl; + break; }; } @@ -177,10 +209,14 @@ void LLViewerStatsRecorder::endObjectUpdateEvents() << mObjectTerseUpdates << " terse updates, " << mObjectCacheMissRequests << " cache miss requests, " << mObjectCacheMissResponses << " cache miss responses, " + << mObjectCacheUpdateDupes << " cache update dupes, " + << mObjectCacheUpdateChanges << " cache update changes, " + << mObjectCacheUpdateAdds << " cache update adds, " + << mObjectCacheUpdateReplacements << " cache update replacements, " << mObjectUpdateFailures << " update failures" << llendl; - S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectUpdateFailures; + S32 total_objects = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; if (mObjectCacheFile != NULL && total_objects > 0) { @@ -197,6 +233,10 @@ void LLViewerStatsRecorder::endObjectUpdateEvents() << ", " << mObjectTerseUpdates << ", " << mObjectCacheMissRequests << ", " << mObjectCacheMissResponses + << ", " << mObjectCacheUpdateDupes + << ", " << mObjectCacheUpdateChanges + << ", " << mObjectCacheUpdateAdds + << ", " << mObjectCacheUpdateReplacements << ", " << mObjectUpdateFailures << "\n"; diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index 001b8d9bd6..16e04fb11e 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -38,6 +38,7 @@ #if LL_RECORD_VIEWER_STATS #include "llframetimer.h" #include "llviewerobject.h" +#include "llviewerregion.h" class LLMutex; class LLViewerRegion; @@ -59,6 +60,7 @@ class LLViewerStatsRecorder void recordObjectUpdateFailure(U32 local_id, const EObjectUpdateType update_type); void recordCacheMissEvent(U32 local_id, const EObjectUpdateType update_type, U8 cache_miss_type); void recordObjectUpdateEvent(U32 local_id, const EObjectUpdateType update_type, LLViewerObject * objectp); + void recordCacheFullUpdate(U32 local_id, const EObjectUpdateType update_type, LLViewerRegion::eCacheUpdateResult update_result, LLViewerObject* objectp); void recordRequestCacheMissesEvent(S32 count); void endObjectUpdateEvents(); @@ -78,6 +80,10 @@ private: S32 mObjectTerseUpdates; S32 mObjectCacheMissRequests; S32 mObjectCacheMissResponses; + S32 mObjectCacheUpdateDupes; + S32 mObjectCacheUpdateChanges; + S32 mObjectCacheUpdateAdds; + S32 mObjectCacheUpdateReplacements; S32 mObjectUpdateFailures; |