diff options
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llagent.cpp | 82 | ||||
-rw-r--r-- | indra/newview/llagent.h | 6 | ||||
-rw-r--r-- | indra/newview/llfloater360capture.cpp | 65 | ||||
-rw-r--r-- | indra/newview/llfloater360capture.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 63 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llviewerregion.h | 21 | ||||
-rw-r--r-- | indra/newview/llviewerstatsrecorder.cpp | 56 | ||||
-rw-r--r-- | indra/newview/llviewerstatsrecorder.h | 28 |
12 files changed, 247 insertions, 223 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9f2d6f746d..775ddb0571 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16964,17 +16964,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>360CaptureUseInterestListCap</key> - <map> - <key>Comment</key> - <string>Flag if set, uses the new InterestList cap to ask the simulator for full content</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>360CaptureJPEGEncodeQuality</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cc9be7244..307f73fab4 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -401,6 +401,7 @@ LLAgent::LLAgent() : mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mTeleportState(TELEPORT_NONE), mRegionp(NULL), + mInterestListMode(LLViewerRegion::IL_MODE_DEFAULT), mAgentOriginGlobal(), mPositionGlobal(), @@ -894,11 +895,19 @@ boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_cal // static void LLAgent::capabilityReceivedCallback(const LLUUID ®ion_id, LLViewerRegion *regionp) -{ - if (regionp && regionp->getRegionID() == region_id) +{ // Changed regions and now have the region capabilities + if (regionp) { - regionp->requestSimulatorFeatures(); - LLAppViewer::instance()->updateNameLookupUrl(regionp); + if (regionp->getRegionID() == region_id) + { + regionp->requestSimulatorFeatures(); + LLAppViewer::instance()->updateNameLookupUrl(regionp); + } + + if (gAgent.getInterestListMode() == LLViewerRegion::IL_MODE_360) + { + gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_360); + } } } @@ -2910,39 +2919,60 @@ void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferr handlePreferredMaturityResult(maturity); } - -bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) -{ - if (!getRegion()) +// Using a new capability, tell the simulator that we want it to send everything +// it knows about and not just what is in front of the camera, in its view +// frustum. We need this feature so that the contents of the region that appears +// in the 6 snapshots which we cannot see and is normally not "considered", is +// also rendered. Typically, this is turned on when the 360 capture floater is +// opened and turned off when it is closed. +// Note: for this version, we do not have a way to determine when "everything" +// has arrived and has been rendered so for now, the proposal is that users +// will need to experiment with the low resolution version and wait for some +// (hopefully) small period of time while the full contents resolves. +// Pass in a flag to ask the simulator/interest list to "send everything" or +// not (the default mode) +void LLAgent::changeInterestListMode(const std::string &new_mode) +{ + if (new_mode != mInterestListMode) { - return false; + mInterestListMode = new_mode; + + // Change interest list mode for all regions. If they are already set for the current mode, + // the setting will have no effect. + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); + ++iter) + { + LLViewerRegion *regionp = *iter; + if (regionp && regionp->isAlive() && regionp->capabilitiesReceived()) + { + regionp->setInterestListMode(mInterestListMode); + } + } } - std::string url = getRegion()->getCapability(capName); + else + { + LL_DEBUGS("360Capture") << "Agent interest list mode is already set to " << mInterestListMode << LL_ENDL; + } +} + - if (url.empty()) +bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestPostCapability(capName, postData, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, mHttpPolicy, postData, cbSuccess, cbFailure); - return true; + return false; } bool LLAgent::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) { - std::string url; - - url = getRegionCapability(capName); - - if (url.empty()) + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestGetCapability(capName, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, mHttpPolicy, cbSuccess, cbFailure); - return true; + return false; } BOOL LLAgent::getAdminOverride() const diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 498bea3c07..b8ac47827a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -294,10 +294,16 @@ public: boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb); void removeRegionChangedCallback(boost::signals2::connection callback); + + void changeInterestListMode(const std::string & new_mode); + const std::string & getInterestListMode() const { return mInterestListMode; } + private: LLViewerRegion *mRegionp; region_changed_signal_t mRegionChangedSignal; + std::string mInterestListMode; // How agent wants regions to send updates + //-------------------------------------------------------------------- // History //-------------------------------------------------------------------- diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 9c25cdbc7d..2c638fa959 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -64,12 +64,10 @@ LLFloater360Capture::LLFloater360Capture(const LLSD& key) // such time as we ask it not to (the dtor). If we crash or // otherwise, exit before this is turned off, the Simulator // will take care of cleaning up for us. - if (gSavedSettings.getBOOL("360CaptureUseInterestListCap")) - { - // send everything to us for as long as this floater is open - const bool send_everything = true; - changeInterestListMode(send_everything); - } + mStartILMode = gAgent.getInterestListMode(); + + // send everything to us for as long as this floater is open + gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_360); } LLFloater360Capture::~LLFloater360Capture() @@ -81,13 +79,15 @@ LLFloater360Capture::~LLFloater360Capture() mWebBrowser->unloadMediaSource(); } - // Tell the Simulator not to send us everything anymore - // and revert to the regular "keyhole" frustum of interest + // Restore interest list mode to the state when started + // Normally LLFloater360Capture tells the Simulator send everything + // and now reverts to the regular "keyhole" frustum of interest // list updates. - if (!LLApp::isExiting() && gSavedSettings.getBOOL("360CaptureUseInterestListCap")) + if (!LLApp::isExiting() && + gSavedSettings.getBOOL("360CaptureUseInterestListCap") && + mStartILMode != gAgent.getInterestListMode()) { - const bool send_everything = false; - changeInterestListMode(send_everything); + gAgent.changeInterestListMode(mStartILMode); } } @@ -170,49 +170,6 @@ void LLFloater360Capture::onChooseQualityRadioGroup() setSourceImageSize(); } -// Using a new capability, tell the simulator that we want it to send everything -// it knows about and not just what is in front of the camera, in its view -// frustum. We need this feature so that the contents of the region that appears -// in the 6 snapshots which we cannot see and is normally not "considered", is -// also rendered. Typically, this is turned on when the 360 capture floater is -// opened and turned off when it is closed. -// Note: for this version, we do not have a way to determine when "everything" -// has arrived and has been rendered so for now, the proposal is that users -// will need to experiment with the low resolution version and wait for some -// (hopefully) small period of time while the full contents resolves. -// Pass in a flag to ask the simulator/interest list to "send everything" or -// not (the default mode) -void LLFloater360Capture::changeInterestListMode(bool send_everything) -{ - LLSD body; - - if (send_everything) - { - body["mode"] = LLSD::String("360"); - } - else - { - body["mode"] = LLSD::String("default"); - } - - if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response) - { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" << - ll_pretty_print_sd(response) << - LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to post an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } -} // There is is a setting (360CaptureSourceImageSize) that holds the size // (width == height since it's a square) of each of the 6 source snapshots. diff --git a/indra/newview/llfloater360capture.h b/indra/newview/llfloater360capture.h index 8f765c0b1b..3fb2c7f3c7 100644 --- a/indra/newview/llfloater360capture.h +++ b/indra/newview/llfloater360capture.h @@ -50,8 +50,6 @@ class LLFloater360Capture: void onOpen(const LLSD& key) override; void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; - void changeInterestListMode(bool send_everything); - const std::string getHTMLBaseFolder(); void capture360Images(); @@ -93,6 +91,8 @@ class LLFloater360Capture: std::string mImageSaveDir; LLPointer<LLImageRaw> mRawImages[6]; + + std::string mStartILMode; }; #endif // LL_FLOATER_360CAPTURE_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d1b240d2c4..fe6676759d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1301,65 +1301,24 @@ class LLAdvancedToggleInterestList360Mode : public view_listener_t public: bool handleEvent(const LLSD &userdata) { - LLSD request; - LLSD body; - - // First do a GET to report on current mode and update stats - if (gAgent.requestGetCapability("InterestList", - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability GET responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) + // Toggle the mode - regions will get updated + if (gAgent.getInterestListMode() == LLViewerRegion::IL_MODE_360) { - LL_DEBUGS("360Capture") << "Successful GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - - // Now do a POST to change the mode - if (sUsing360) - { - body["mode"] = LLSD::String("default"); - } - else - { - body["mode"] = LLSD::String("360"); - } - sUsing360 = !sUsing360; - LL_INFOS("360Capture") << "Setting InterestList capability mode to " << body["mode"].asString() << LL_ENDL; - - if (gAgent.requestPostCapability("InterestList", body, - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return true; - } - else - { - LL_DEBUGS("360Capture") << "Unable to post an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return false; - } - }; - - static bool sUsing360; + gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_DEFAULT); + } + else + { + gAgent.changeInterestListMode(LLViewerRegion::IL_MODE_360); + } + return true; + } }; -bool LLAdvancedToggleInterestList360Mode::sUsing360 = false; - class LLAdvancedCheckInterestList360Mode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return LLAdvancedToggleInterestList360Mode::sUsing360; + return (gAgent.getInterestListMode() == LLViewerRegion::IL_MODE_360); } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a60f11d97b..ef83fa161b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -99,6 +99,7 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" @@ -3759,31 +3760,34 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) continue; } - LLViewerObject *objectp = gObjectList.findObject(id); - if (objectp) + LLViewerObject *objectp = gObjectList.findObject(id); + if (objectp) + { + // Display green bubble on kill + if ( gShowObjectUpdates ) { - // Display green bubble on kill - if ( gShowObjectUpdates ) - { - LLColor4 color(0.f,1.f,0.f,1.f); - gPipeline.addDebugBlip(objectp->getPositionAgent(), color); - LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; - } - - // Do the kill - gObjectList.killObject(objectp); + LLColor4 color(0.f,1.f,0.f,1.f); + gPipeline.addDebugBlip(objectp->getPositionAgent(), color); + LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; } - if(delete_object) - { - regionp->killCacheEntry(local_id); + // Do the kill + gObjectList.killObject(objectp); + } + + if(delete_object) + { + regionp->killCacheEntry(local_id); } // We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab, // which is using the object, release the mouse capture correctly when the object dies. // See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical(). LLSelectMgr::getInstance()->removeObjectFromSelections(id); - } + + } // end for loop + + LLViewerStatsRecorder::instance().recordObjectKills(num_objects); } void process_time_synch(LLMessageSystem *mesgsys, void **user_data) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0c9e929cf3..5f0e331baa 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -369,7 +369,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(0); + recorder.objectUpdateFailure(); return NULL; } justCreated = true; @@ -501,7 +501,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, << " Flags: " << flags << " Region: " << regionp->getName() << " Region id: " << regionp->getRegionID() << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0) @@ -612,7 +612,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type == OUT_TERSE_IMPROVED) { // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } } @@ -621,7 +621,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type != OUT_FULL) { //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } @@ -634,7 +634,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { mNumDeadObjectUpdates++; //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } #endif @@ -647,7 +647,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 54d787366f..9c2dc3c761 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -104,6 +104,9 @@ S32 LLViewerRegion::sLastCameraUpdated = 0; S32 LLViewerRegion::sNewObjectCreationThrottle = -1; LLViewerRegion::vocache_entry_map_t LLViewerRegion::sRegionCacheCleanup; +const std::string LLViewerRegion::IL_MODE_DEFAULT = "default"; +const std::string LLViewerRegion::IL_MODE_360 = "360"; + typedef std::map<std::string, std::string> CapabilityMap; static void log_capabilities(const CapabilityMap &capmap); @@ -646,7 +649,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mInvisibilityCheckHistory(-1), mPaused(FALSE), mRegionCacheHitCount(0), - mRegionCacheMissCount(0) + mRegionCacheMissCount(0), + mInterestListMode(IL_MODE_DEFAULT) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -3283,6 +3287,9 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) // This is a single-shot signal. Forget callbacks to save resources. mCapabilitiesReceivedSignal.disconnect_all_slots(); + + // Set the region to the desired interest list mode + setInterestListMode(gAgent.getInterestListMode()); } } @@ -3301,7 +3308,82 @@ void LLViewerRegion::logActiveCapabilities() const log_capabilities(mImpl->mCapabilities); } -LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) + +bool LLViewerRegion::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " POST capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, gAgent.getAgentPolicy(), postData, cbSuccess, cbFailure); + return true; +} + +bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url; + + url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " GET capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, gAgent.getAgentPolicy(), cbSuccess, cbFailure); + return true; +} + + +void LLViewerRegion::setInterestListMode(const std::string &new_mode) +{ + if (new_mode != mInterestListMode) + { + mInterestListMode = new_mode; + + if (mInterestListMode != std::string(IL_MODE_DEFAULT) && mInterestListMode != std::string(IL_MODE_360)) + { + LL_WARNS("360Capture") << "Region " << getRegionID() << " setInterestListMode() invalid interest list mode: " + << mInterestListMode << ", setting to default" << LL_ENDL; + mInterestListMode = IL_MODE_DEFAULT; + } + + LLSD body; + body["mode"] = mInterestListMode; + if (requestPostCapability("InterestList", body, + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() + << " Successfully posted an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Region " << getRegionID() + << " Unable to post an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + } + else + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() << "No change, skipping Interest List mode POST to " + << new_mode << " mode" << LL_ENDL; + } +} + + + +LLSpatialPartition *LLViewerRegion::getSpatialPartition(U32 type) { if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE) { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 81371b7f30..6308058f63 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -32,6 +32,7 @@ #include <string> #include <boost/signals2.hpp> +#include "llcorehttputil.h" #include "llwind.h" #include "v3dmath.h" #include "llstring.h" @@ -278,6 +279,15 @@ public: static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; + // Utilities to post and get via + // HTTP using the agent's policy settings and headers. + typedef LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t httpCallback_t; + bool requestPostCapability(const std::string &capName, + LLSD &postData, + httpCallback_t cbSuccess = NULL, + httpCallback_t cbFailure = NULL); + bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + /// implements LLCapabilityProvider /*virtual*/ const LLHost& getHost() const; const U64 &getHandle() const { return mHandle; } @@ -477,7 +487,13 @@ public: }; typedef std::set<LLViewerRegion*, CompareRegionByLastUpdate> region_priority_list_t; -private: + void setInterestListMode(const std::string & new_mode); + const std::string & getInterestListMode() const { return mInterestListMode; } + + static const std::string IL_MODE_DEFAULT; + static const std::string IL_MODE_360; + + private: static S32 sNewObjectCreationThrottle; LLViewerRegionImpl * mImpl; LLFrameTimer mRegionTimer; @@ -574,6 +590,9 @@ private: LLFrameTimer mMaterialsCapThrottleTimer; LLFrameTimer mRenderInfoRequestTimer; LLFrameTimer mRenderInfoReportTimer; + + // how the server interest list works + std::string mInterestListMode; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index f95a960186..6372679a07 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -73,15 +73,14 @@ void LLViewerStatsRecorder::clearStats() mObjectFullUpdates = 0; mObjectTerseUpdates = 0; mObjectCacheMissRequests = 0; - mObjectCacheMissResponses = 0; mObjectCacheUpdateDupes = 0; mObjectCacheUpdateChanges = 0; mObjectCacheUpdateAdds = 0; mObjectCacheUpdateReplacements = 0; mObjectUpdateFailures = 0; - mObjectUpdateFailuresSize = 0; mTextureFetchCount = 0; mMeshLoadedCount = 0; + mObjectKills = 0; } @@ -100,12 +99,6 @@ void LLViewerStatsRecorder::enableObjectStatsRecording(bool enable, bool logging -void LLViewerStatsRecorder::recordObjectUpdateFailure(S32 msg_size) -{ - mObjectUpdateFailures++; - mObjectUpdateFailuresSize += msg_size; -} - void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) { if (LLViewerRegion::CACHE_MISS_TYPE_TOTAL == cache_miss_type) @@ -119,24 +112,17 @@ void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) } -void LLViewerStatsRecorder::recordCacheHitEvent() -{ - mObjectCacheHitCount++; -} - void LLViewerStatsRecorder::recordObjectUpdateEvent(const EObjectUpdateType update_type) { switch (update_type) { case OUT_FULL: - mObjectFullUpdates++; + case OUT_FULL_COMPRESSED: + mObjectFullUpdates++; break; case OUT_TERSE_IMPROVED: mObjectTerseUpdates++; break; - case OUT_FULL_COMPRESSED: - mObjectCacheMissResponses++; - break; default: LL_WARNS() << "Unknown update_type" << LL_ENDL; break; @@ -165,11 +151,6 @@ void LLViewerStatsRecorder::recordCacheFullUpdate(LLViewerRegion::eCacheUpdateRe }; } -void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) -{ - mObjectCacheMissRequests += count; -} - void LLViewerStatsRecorder::writeToLog( F32 interval ) { if (!mEnableStatsLogging || !mEnableStatsRecording) @@ -185,7 +166,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) if (mSkipSaveIfZeros) { S32 total_events = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + - mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; if (total_events == 0) { @@ -202,14 +183,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectFullUpdates << " full updates, " << 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" + << mObjectCacheUpdateReplacements << " cache update replacements," + << mObjectUpdateFailures << " update failures," + << mTextureFetchCount << " texture fetches, " + << mMeshLoadedCount << " mesh loads, " + << mObjectKills << " object kills" << LL_ENDL; - + if (mStatsFile == NULL) { // Refresh settings @@ -237,8 +220,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Cache Crc Misses," << "Full Updates," << "Terse Updates," - << "Cache Miss Requests," - << "Cache Miss Responses," + << "Cache Miss Requests," // Normally results in a Full Update from simulator << "Cache Update Dupes," << "Cache Update Changes," << "Cache Update Adds," @@ -246,12 +228,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Update Failures," << "Texture Count," << "Mesh Load Count," + << "Object Kills" << "\n"; data_size = col_headers.str().size(); if (fwrite(col_headers.str().c_str(), 1, data_size, mStatsFile ) != data_size) { LL_WARNS() << "failed to write full headers to " << mStatsFileName << LL_ENDL; + // Close the file and turn off stats logging + closeStatsFile(); + return; } } else @@ -273,7 +259,6 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectFullUpdates << "," << mObjectTerseUpdates << "," << mObjectCacheMissRequests - << "," << mObjectCacheMissResponses << "," << mObjectCacheUpdateDupes << "," << mObjectCacheUpdateChanges << "," << mObjectCacheUpdateAdds @@ -281,6 +266,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectUpdateFailures << "," << mTextureFetchCount << "," << mMeshLoadedCount + << "," << mObjectKills << "\n"; data_size = stats_data.str().size(); @@ -332,14 +318,4 @@ F32 LLViewerStatsRecorder::getTimeSinceStart() return (F32) (LLFrameTimer::getTotalSeconds() - mFileOpenTime); } -void LLViewerStatsRecorder::recordTextureFetch() -{ - mTextureFetchCount += 1; -} - -void LLViewerStatsRecorder::recordMeshLoaded() -{ - mMeshLoadedCount += 1; -} - diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index 37c08a51cf..b9fe02e54d 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -53,11 +53,11 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> bool isEnabled() const { return mEnableStatsRecording; } bool isLogging() const { return mEnableStatsLogging; } - void objectUpdateFailure(S32 msg_size) + void objectUpdateFailure() { if (mEnableStatsRecording) { - recordObjectUpdateFailure(msg_size); + mObjectUpdateFailures++; } } @@ -73,7 +73,7 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> { if (mEnableStatsRecording) { - recordCacheHitEvent(); + mObjectCacheHitCount++; } } @@ -97,7 +97,7 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> { if (mEnableStatsRecording) { - recordRequestCacheMissesEvent(count); + mObjectCacheMissRequests += count; } } @@ -105,7 +105,7 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> { if (mEnableStatsRecording) { - recordTextureFetch(); + mTextureFetchCount += 1; } } @@ -113,10 +113,18 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> { if (mEnableStatsRecording) { - recordMeshLoaded(); + mMeshLoadedCount += 1; } } + void recordObjectKills(S32 num_objects) + { + if (mEnableStatsRecording) + { + mObjectKills += num_objects; + } + } + void idle() { writeToLog(mInterval); @@ -125,14 +133,9 @@ class LLViewerStatsRecorder : public LLSingleton<LLViewerStatsRecorder> F32 getTimeSinceStart(); private: - void recordObjectUpdateFailure(S32 msg_size); void recordCacheMissEvent(U8 cache_miss_type); - void recordCacheHitEvent(); void recordObjectUpdateEvent(const EObjectUpdateType update_type); void recordCacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result); - void recordRequestCacheMissesEvent(S32 count); - void recordTextureFetch(); - void recordMeshLoaded(); void writeToLog(F32 interval); void closeStatsFile(); void makeStatsFileName(); @@ -158,15 +161,14 @@ private: S32 mObjectFullUpdates; S32 mObjectTerseUpdates; S32 mObjectCacheMissRequests; - S32 mObjectCacheMissResponses; S32 mObjectCacheUpdateDupes; S32 mObjectCacheUpdateChanges; S32 mObjectCacheUpdateAdds; S32 mObjectCacheUpdateReplacements; S32 mObjectUpdateFailures; - S32 mObjectUpdateFailuresSize; S32 mTextureFetchCount; S32 mMeshLoadedCount; + S32 mObjectKills; void clearStats(); }; |