diff options
Diffstat (limited to 'indra/newview')
40 files changed, 123 insertions, 309 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a41efbe0b2..ac33f09718 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -754,7 +754,6 @@ void LLAgent::setFlying(BOOL fly) if( !was_flying ) { LLStatViewer::FLY.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_FLY_COUNT); } setControlFlags(AGENT_CONTROL_FLY); } @@ -3811,7 +3810,6 @@ bool LLAgent::teleportCore(bool is_local) // local logic LLStatViewer::TELEPORT.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TELEPORT_COUNT); if (is_local) { gAgent.setTeleportState( LLAgent::TELEPORT_LOCAL ); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6e0b298b2a..4ab0e3336a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -277,7 +277,7 @@ LLPumpIO* gServicePump = NULL; U64 gFrameTime = 0; F32 gFrameTimeSeconds = 0.f; -F32 gFrameIntervalSeconds = 0.f; +LLUnit::Seconds<F32> gFrameIntervalSeconds = 0.f; F32 gFPSClamped = 10.f; // Pretend we start at target rate. F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds @@ -1395,7 +1395,7 @@ bool LLAppViewer::mainLoop() { S32 work_pending = 0; S32 io_pending = 0; - F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f); + F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f); { LLFastTimer ftm(FTM_TEXTURE_CACHE); @@ -4811,7 +4811,6 @@ void LLAppViewer::idleNetwork() } } LLStatViewer::NUM_NEW_OBJECTS.sample(gObjectList.mNumNewObjects); - //LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. gXferManager->retransmitUnackedPackets(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index cdf4426469..d9d888c626 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -31,6 +31,7 @@ #include "llcontrol.h" #include "llsys.h" // for LLOSInfo #include "lltimer.h" +#include "llunit.h" class LLCommandLineParser; class LLFrameTimer; @@ -321,7 +322,7 @@ extern LLPumpIO* gServicePump; extern U64 gFrameTime; // The timestamp of the most-recently-processed frame extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours... -extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds +extern LLUnit::Seconds<F32> gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame extern F32 gFrameDTClamped; extern U64 gStartTime; diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 6739910c38..033c8f4865 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -436,8 +436,6 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { LLSD args; diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp index d0c22d25f2..f7b2670b8e 100644 --- a/indra/newview/llfloaterjoystick.cpp +++ b/indra/newview/llfloaterjoystick.cpp @@ -61,7 +61,7 @@ void LLFloaterJoystick::draw() for (U32 i = 0; i < 6; i++) { F32 value = joystick->getJoystickAxis(i); - mAxisStats[i]->addValue(value * gFrameIntervalSeconds); + mAxisStats[i]->addValue(value * gFrameIntervalSeconds.value()); if (mAxisStatsBar[i]) { F32 minbar, maxbar; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8234841966..6cce013105 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2491,8 +2491,6 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 4a58e0186c..0d90037e7b 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -993,7 +993,6 @@ void LLSnapshotLivePreview::saveTexture() } LLStatViewer::SNAPSHOT.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT ); mDataSize = 0; } diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 63ef8c3d21..27a29d3ace 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1137,8 +1137,6 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 1666425cbe..2a131eff58 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -141,7 +141,6 @@ void LLLandmarkList::processGetAssetReply( } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); // SJB: No use case for a notification here. Use lldebugs instead if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 0aced5c575..23cbfae044 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -639,7 +639,6 @@ void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 gAgent.sendReliableMessage(); LLStatViewer::CHAT_COUNT.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); } class LLChatCommandHandler : public LLCommandHandler diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 52ed24f06d..39ded21183 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1050,7 +1050,6 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item) void LLPanelFace::onCommitTexture( const LLSD& data ) { LLStatViewer::EDIT_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); sendTexture(); } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 51ab7649a4..8027783bd8 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -915,7 +915,6 @@ bool callback_deed_to_group(const LLSD& notification, const LLSD& response) if(group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) { LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); -// LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } } return false; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 4082d272f2..cbb4d5f964 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -883,8 +883,6 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index b93b97f1e0..97c9de4b72 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -339,8 +339,6 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 059d5d4061..7607df5a55 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -943,7 +943,6 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata) void LLScriptEdCore::doSave( BOOL close_after_save ) { LLStatViewer::LSL_SAVES.add(1); - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT ); if( mSaveCallback ) { @@ -1148,7 +1147,6 @@ void LLScriptEdCore::onBtnLoadFromFile( void* data ) void LLScriptEdCore::onBtnSaveToFile( void* userdata ) { LLStatViewer::LSL_SAVES.add(1); - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT ); LLScriptEdCore* self = (LLScriptEdCore*) userdata; @@ -1671,8 +1669,6 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { @@ -1903,8 +1899,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index fd03d7c0be..36ce7bb60e 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1551,7 +1551,6 @@ void LLObjectSelection::applyNoCopyTextureToTEs(LLViewerInventoryItem* item) // apply texture for the selected faces LLStatViewer::EDIT_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); object->setTEImage(te, image); dialog_refresh_all(); diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index c351b1a128..8fb56eb6d8 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -945,7 +945,6 @@ static bool callback_deed_to_group(const LLSD& notification, const LLSD& respons if (group_id.notNull() && groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) { LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); -// LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } } return FALSE; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5083478392..c4c9b0bd4c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1580,7 +1580,7 @@ void LLSpatialGroup::checkOcclusion() LLFastTimer t(FTM_OCCLUSION_WAIT); while (!available && max_loop-- > 0) { - F32 max_time = llmin(gFrameIntervalSeconds*10.f, 1.f); + F32 max_time = llmin(gFrameIntervalSeconds.value()*10.f, 1.f); //do some usefu work while we wait LLAppViewer::getTextureCache()->update(max_time); // unpauses the texture cache thread LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread @@ -2574,7 +2574,7 @@ void renderOctree(LLSpatialGroup* group) LLVector4 col; if (group->mBuilt > 0.f) { - group->mBuilt -= 2.f * gFrameIntervalSeconds; + group->mBuilt -= 2.f * gFrameIntervalSeconds.value(); if (group->mBufferUsage == GL_STATIC_DRAW_ARB) { col.setVec(1.0f, 0, 0, group->mBuilt*0.5f); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index cb3c90ea2a..bf47bd44c3 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2072,7 +2072,6 @@ bool idle_startup() { LLNotificationsUtil::add("ClothingLoading"); LLStatViewer::LOADING_WEARABLES_LONG_DELAY.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index e354a5c59d..909745c5b6 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -461,7 +461,6 @@ void LLTexLayerSetBuffer::doUpload() { llinfos << "Uploading baked " << mTexLayerSet->getBodyRegionName() << llendl; LLStatViewer::TEX_BAKES.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_BAKES); // Don't need caches since we're baked now. (note: we won't *really* be baked // until this image is sent to the server and the Avatar Appearance message is received.) diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index a88233e120..d734620f10 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -512,8 +512,8 @@ void LLGLTexMemBar::draw() F32 cache_max_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); - F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); - F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024); + LLUnit::Megabytes<F32> total_texture_downloaded = gTotalTextureData; + LLUnit::Megabytes<F32> total_object_downloaded = gTotalObjectData; U32 total_http_requests = LLAppViewer::getTextureFetch()->getCurlRequest().getTotalIssuedRequests() ; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -537,7 +537,7 @@ void LLGLTexMemBar::draw() text_color, LLFontGL::LEFT, LLFontGL::TOP); text = llformat("Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d", - total_texture_downloaded, total_object_downloaded, total_http_requests); + total_texture_downloaded.value(), total_object_downloaded.value(), total_http_requests); //, cache_entries, cache_max_entries LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, text_color, LLFontGL::LEFT, LLFontGL::TOP); diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 791da59a1a..652847aac9 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1063,7 +1063,6 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, } LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); LLStatViewer::EDIT_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); S32 num_faces = hit_obj->getNumTEs(); for( S32 face = 0; face < num_faces; face++ ) { @@ -1132,7 +1131,6 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, // update viewer side image in anticipation of update from simulator LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); LLStatViewer::EDIT_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); hit_obj->setTEImage(hit_face, image); dialog_refresh_all(); @@ -1357,7 +1355,6 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, effectp->setColor(LLColor4U(gAgent.getEffectColor())); LLStatViewer::OBJECT_REZ.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_REZ_COUNT); } void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index cf5a6e3762..329249eee8 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -434,7 +434,6 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) effectp->setColor(LLColor4U(gAgent.getEffectColor())); LLStatViewer::OBJECT_CREATE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CREATE_COUNT); return TRUE; } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index e556743cbf..44e4c54142 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -84,6 +84,30 @@ // ------------------------------------------------------ LLViewerAssetStats * gViewerAssetStatsMain(0); LLViewerAssetStats * gViewerAssetStatsThread1(0); +LLTrace::Count<> LLViewerAssetStats::sEnqueued[EVACCount] = {LLTrace::Count<>("enqueuedassetrequeststemptexturehttp", "Number of temporary texture asset http requests enqueued"), + LLTrace::Count<>("enqueuedassetrequeststemptextureudp", "Number of temporary texture asset udp requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestsnontemptexturehttp", "Number of texture asset http requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestsnontemptextureudp", "Number of texture asset udp requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestswearableudp", "Number of wearable asset requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestssoundudp", "Number of sound asset requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestsgestureudp", "Number of gesture asset requests enqueued"), + LLTrace::Count<>("enqueuedassetrequestsother", "Number of other asset requests enqueued")}; +LLTrace::Count<> LLViewerAssetStats::sDequeued[EVACCount] = {LLTrace::Count<>("dequeuedassetrequeststemptexturehttp", "Number of temporary texture asset http requests dequeued"), + LLTrace::Count<>("dequeuedassetrequeststemptextureudp", "Number of temporary texture asset udp requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestsnontemptexturehttp", "Number of texture asset http requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestsnontemptextureudp", "Number of texture asset udp requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestswearableudp", "Number of wearable asset requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestssoundudp", "Number of sound asset requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestsgestureudp", "Number of gesture asset requests dequeued"), + LLTrace::Count<>("dequeuedassetrequestsother", "Number of other asset requests dequeued")}; +LLTrace::Measurement<LLTrace::Seconds> LLViewerAssetStats::sResponse[EVACCount] = {LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimestemptexturehttp", "Time spent responding to temporary texture asset http requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimestemptextureudp", "Time spent responding to temporary texture asset udp requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimesnontemptexturehttp", "Time spent responding to texture asset http requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimesnontemptextureudp", "Time spent responding to texture asset udp requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimeswearableudp", "Time spent responding to wearable asset requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimessoundudp", "Time spent responding to sound asset requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimesgestureudp", "Time spent responding to gesture asset requests"), + LLTrace::Measurement<LLTrace::Seconds>("assetresponsetimesother", "Time spent responding to other asset requests")}; // ------------------------------------------------------ @@ -234,6 +258,7 @@ LLViewerAssetStats::recordGetEnqueued(LLViewerAssetType::EType at, bool with_htt const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); ++(mCurRegionStats->mRequests[int(eac)].mEnqueued); + sEnqueued[int(eac)].add(1); } void @@ -242,6 +267,7 @@ LLViewerAssetStats::recordGetDequeued(LLViewerAssetType::EType at, bool with_htt const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); ++(mCurRegionStats->mRequests[int(eac)].mDequeued); + sDequeued[int(eac)].add(1); } void @@ -250,6 +276,7 @@ LLViewerAssetStats::recordGetServiced(LLViewerAssetType::EType at, bool with_htt const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); mCurRegionStats->mRequests[int(eac)].mResponse.record(duration); + sResponse[int(eac)].sample<LLTrace::Seconds>(duration); } void diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 8319752230..a750db2cc2 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -37,6 +37,7 @@ #include "llsimplestat.h" #include "llsd.h" #include "llvoavatar.h" +#include "lltrace.h" /** * @class LLViewerAssetStats @@ -240,6 +241,7 @@ public: protected: typedef std::map<region_handle_t, LLPointer<PerRegionStats> > PerRegionContainer; + typedef std::map<region_handle_t, LLTrace::Recording > PerRegionRecordingContainer; // Region of the currently-active region. Always valid but may // be zero after construction or when explicitly set. Unchanged @@ -251,8 +253,13 @@ protected: // Always points to a collection contained in mRegionStats. LLPointer<PerRegionStats> mCurRegionStats; + static LLTrace::Count<> sEnqueued[EVACCount]; + static LLTrace::Count<> sDequeued[EVACCount]; + static LLTrace::Measurement<LLTrace::Seconds> sResponse[EVACCount]; + // Metrics data for all regions during one collection cycle PerRegionContainer mRegionStats; + PerRegionRecordingContainer mRegionRecordings; // Time of last reset duration_t mResetTimestamp; diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ffeea2f4df..169b45c14e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -607,7 +607,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLFastTimer t(FTM_DISPLAY_UPDATE_GEOM); - const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds; // 50 ms/second update time + const F32 max_geom_update_time = 0.005f*10.f*gFrameIntervalSeconds.value(); // 50 ms/second update time gPipeline.createObjects(max_geom_update_time); gPipeline.processPartitionQ(); gPipeline.updateGeom(max_geom_update_time); @@ -760,7 +760,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLFastTimer t(FTM_IMAGE_UPDATE_LIST); - F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time + F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds.value(); // 50 ms/second decode time max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame) gTextureList.updateImages(max_image_decode_time); } diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index f6e840adcd..f4155df4d1 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -501,7 +501,7 @@ void LLViewerJoystick::moveObjects(bool reset) }; F32 cur_delta[6]; - F32 time = gFrameIntervalSeconds; + F32 time = gFrameIntervalSeconds.value(); // avoid making ridicously big movements if there's a big drop in fps if (time > .2f) @@ -665,7 +665,7 @@ void LLViewerJoystick::moveAvatar(bool reset) }; // time interval in seconds between this frame and the previous - F32 time = gFrameIntervalSeconds; + F32 time = gFrameIntervalSeconds.value(); // avoid making ridicously big movements if there's a big drop in fps if (time > .2f) @@ -878,7 +878,7 @@ void LLViewerJoystick::moveFlycam(bool reset) gSavedSettings.getF32("FlycamAxisDeadZone6") }; - F32 time = gFrameIntervalSeconds; + F32 time = gFrameIntervalSeconds.value(); // avoid making ridiculously big movements if there's a big drop in fps if (time > .2f) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7ce8cdcfd8..50ca8db267 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -1097,19 +1097,16 @@ void upload_new_resource( if( LLAssetType::AT_SOUND == asset_type ) { LLStatViewer::UPLOAD_SOUND.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if( LLAssetType::AT_TEXTURE == asset_type ) { LLStatViewer::UPLOAD_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if( LLAssetType::AT_ANIMATION == asset_type) { LLStatViewer::ANIMATION_UPLOADS.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } if(LLInventoryType::IT_NONE == inv_type) @@ -1235,20 +1232,14 @@ void increase_new_upload_stats(LLAssetType::EType asset_type) if ( LLAssetType::AT_SOUND == asset_type ) { LLStatViewer::UPLOAD_SOUND.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if ( LLAssetType::AT_TEXTURE == asset_type ) { LLStatViewer::UPLOAD_TEXTURE.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if ( LLAssetType::AT_ANIMATION == asset_type ) { LLStatViewer::ANIMATION_UPLOADS.add(1); - //LLViewerStats::getInstance()->incStat( - // LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b3e1c9bdbe..82caa05983 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4416,18 +4416,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // *TODO: Remove this dependency, or figure out a better way to handle // this hack. -extern U32 gObjectBits; +extern LLUnit::Bits<U32> gObjectData; void process_object_update(LLMessageSystem *mesgsys, void **user_data) { // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectBits += mesgsys->getReceiveCompressedSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectBits += mesgsys->getReceiveSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4439,11 +4439,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectBits += mesgsys->getReceiveCompressedSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectBits += mesgsys->getReceiveSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4455,11 +4455,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectBits += mesgsys->getReceiveCompressedSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectBits += mesgsys->getReceiveSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4471,11 +4471,11 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ { if (mesgsys->getReceiveCompressedSize()) { - gObjectBits += mesgsys->getReceiveCompressedSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectBits += mesgsys->getReceiveSize() * 8; + gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); } gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); @@ -4763,140 +4763,6 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) { llwarns << "Unknown sim stat identifier: " << stat_id << llendl; } - //switch (stat_id) - //{ - //case LL_SIM_STAT_TIME_DILATION: - // LLStatViewer::SIM_TIME_DILATION.sample(stat_value); - // //LLViewerStats::getInstance()->mSimTimeDilation.addValue(stat_value); - // break; - //case LL_SIM_STAT_FPS: - // LLStatViewer::SIM_FPS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimFPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_PHYSFPS: - // LLStatViewer::SIM_PHYSICS_FPS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimPhysicsFPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_AGENTUPS: - // LLStatViewer::SIM_AGENT_UPS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimAgentUPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_FRAMEMS: - // LLStatViewer::SIM_FRAME_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimFrameMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_NETMS: - // LLStatViewer::SIM_NET_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimNetMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMOTHERMS: - // LLStatViewer::SIM_PHYSICS_OTHER_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimSimOtherMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMPHYSICSMS: - // LLStatViewer::SIM_PHYSICS_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimSimPhysicsMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_AGENTMS: - // LLStatViewer::SIM_AGENTS_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimAgentMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_IMAGESMS: - // LLStatViewer::SIM_IMAGES_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimImagesMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SCRIPTMS: - // LLStatViewer::SIM_SCRIPTS_TIME.sample(stat_value); - // //LLViewerStats::getInstance()->mSimScriptMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_NUMTASKS: - // LLStatViewer::SIM_OBJECTS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimObjects.addValue(stat_value); - // break; - //case LL_SIM_STAT_NUMTASKSACTIVE: - // LLStatViewer::SIM_ACTIVE_OBJECTS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimActiveObjects.addValue(stat_value); - // break; - //case LL_SIM_STAT_NUMAGENTMAIN: - // LLStatViewer::SIM_MAIN_AGENTS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimMainAgents.addValue(stat_value); - // break; - //case LL_SIM_STAT_NUMAGENTCHILD: - // LLStatViewer::SIM_CHILD_AGENTS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimChildAgents.addValue(stat_value); - // break; - //case LL_SIM_STAT_NUMSCRIPTSACTIVE: - // LLStatViewer::SIM_ACTIVE_SCRIPTS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimActiveScripts.addValue(stat_value); - // break; - //case LL_SIM_STAT_SCRIPT_EPS: - // LLStatViewer::SIM_SCRIPT_EPS.sample(stat_value); - // //LLViewerStats::getInstance()->mSimScriptEPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_INPPS: - // LLStatViewer::SIM_IN_PACKETS_PER_SEC.sample(stat_value); - // //LLViewerStats::getInstance()->mSimInPPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_OUTPPS: - // LLStatViewer::SIM_OUT_PACKETS_PER_SEC.sample(stat_value); - // //LLViewerStats::getInstance()->mSimOutPPS.addValue(stat_value); - // break; - //case LL_SIM_STAT_PENDING_DOWNLOADS: - // LLViewerStats::getInstance()->mSimPendingDownloads.addValue(stat_value); - // break; - //case LL_SIM_STAT_PENDING_UPLOADS: - // LLViewerStats::getInstance()->mSimPendingUploads.addValue(stat_value); - // break; - //case LL_SIM_STAT_PENDING_LOCAL_UPLOADS: - // LLViewerStats::getInstance()->mSimPendingLocalUploads.addValue(stat_value); - // break; - //case LL_SIM_STAT_TOTAL_UNACKED_BYTES: - // LLViewerStats::getInstance()->mSimTotalUnackedBytes.addValue(stat_value / 1024.f); - // break; - //case LL_SIM_STAT_PHYSICS_PINNED_TASKS: - // LLViewerStats::getInstance()->mPhysicsPinnedTasks.addValue(stat_value); - // break; - //case LL_SIM_STAT_PHYSICS_LOD_TASKS: - // LLViewerStats::getInstance()->mPhysicsLODTasks.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMPHYSICSSTEPMS: - // LLViewerStats::getInstance()->mSimSimPhysicsStepMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMPHYSICSSHAPEMS: - // LLViewerStats::getInstance()->mSimSimPhysicsShapeUpdateMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMPHYSICSOTHERMS: - // LLViewerStats::getInstance()->mSimSimPhysicsOtherMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMPHYSICSMEMORY: - // LLViewerStats::getInstance()->mPhysicsMemoryAllocated.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMSPARETIME: - // LLViewerStats::getInstance()->mSimSpareMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMSLEEPTIME: - // LLViewerStats::getInstance()->mSimSleepMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_IOPUMPTIME: - // LLViewerStats::getInstance()->mSimPumpIOMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_PCTSCRIPTSRUN: - // LLViewerStats::getInstance()->mSimPctScriptsRun.addValue(stat_value); - // break; - //case LL_SIM_STAT_SIMAISTEPTIMEMS: - // LLViewerStats::getInstance()->mSimSimAIStepMsec.addValue(stat_value); - // break; - //case LL_SIM_STAT_SKIPPEDAISILSTEPS_PS: - // LLViewerStats::getInstance()->mSimSimSkippedSilhouetteSteps.addValue(stat_value); - // break; - //case LL_SIM_STAT_PCTSTEPPEDCHARACTERS: - // LLViewerStats::getInstance()->mSimSimPctSteppedCharacters.addValue(stat_value); - // break; - //default: - // // Used to be a commented out warning. - // LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; - // break; - //} } /* @@ -5968,7 +5834,6 @@ void process_alert_core(const std::string& message, BOOL modal) if ( message == "You died and have been teleported to your home location") { LLStatViewer::KILLED.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); } else if( message == "Home position set." ) { @@ -7395,8 +7260,6 @@ void onCovenantLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 747dfd3250..ca404858cf 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2034,7 +2034,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) ) { LLStatViewer::AGENT_POSITION_SNAP.sample<LLTrace::Meters>(diff.length()); - //LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() ); } } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 2f171f89d7..14a2ac3384 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1033,10 +1033,6 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) LLStatViewer::NUM_ACTIVE_OBJECTS.sample(idle_count); LLStatViewer::NUM_SIZE_CULLED.sample(mNumSizeCulled); LLStatViewer::NUM_VIS_CULLED.sample(mNumVisCulled); - //LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size()); - //LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(idle_count); - //LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled); - //LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled); } void LLViewerObjectList::fetchObjectCosts() diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index ccc0c9ba59..963d2ebb81 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -206,72 +206,53 @@ void LLViewerStats::resetStats() void LLViewerStats::updateFrameStats(const F64 time_diff) { + LLTrace::Seconds time_diff_seconds(time_diff); if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { - LLStatViewer::LOSS_5_PERCENT_TIME.add(time_diff); - //incStat(ST_LOSS_05_SECONDS, time_diff); + LLStatViewer::LOSS_5_PERCENT_TIME.add(time_diff_seconds); } F32 sim_fps = getRecording().getLastValue(LLStatViewer::SIM_FPS); if (0.f < sim_fps && sim_fps < 20.f) { - LLStatViewer::SIM_20_FPS_TIME.add(time_diff); - //incStat(ST_SIM_FPS_20_SECONDS, time_diff); + LLStatViewer::SIM_20_FPS_TIME.add(time_diff_seconds); } F32 sim_physics_fps = getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS); if (0.f < sim_physics_fps && sim_physics_fps < 20.f) { - LLStatViewer::SIM_PHYSICS_20_FPS_TIME.add(time_diff); - //incStat(ST_PHYS_FPS_20_SECONDS, time_diff); + LLStatViewer::SIM_PHYSICS_20_FPS_TIME.add(time_diff_seconds); } if (time_diff >= 0.5) { - LLStatViewer::FPS_2_TIME.add(time_diff); - //incStat(ST_FPS_2_SECONDS, time_diff); + LLStatViewer::FPS_2_TIME.add(time_diff_seconds); } if (time_diff >= 0.125) { - LLStatViewer::FPS_8_TIME.add(time_diff); - //incStat(ST_FPS_8_SECONDS, time_diff); + LLStatViewer::FPS_8_TIME.add(time_diff_seconds); } if (time_diff >= 0.1) { - LLStatViewer::FPS_10_TIME.add(time_diff); - //incStat(ST_FPS_10_SECONDS, time_diff); + LLStatViewer::FPS_10_TIME.add(time_diff_seconds); } if (gFrameCount && mLastTimeDiff > 0.0) { // new "stutter" meter LLStatViewer::FRAMETIME_DOUBLED.add(time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); - //setStat(ST_FPS_DROP_50_RATIO, - // (getStat(ST_FPS_DROP_50_RATIO) * (F64)(gFrameCount - 1) + - // (time_diff >= 2.0 * mLastTimeDiff ? 1.0 : 0.0)) / gFrameCount); - // old stats that were never really used - LLStatViewer::FRAMETIME_JITTER.sample(mLastTimeDiff - time_diff); - //setStat(ST_FRAMETIME_JITTER, - // (getStat(ST_FRAMETIME_JITTER) * (gFrameCount - 1) + - // fabs(mLastTimeDiff - time_diff) / mLastTimeDiff) / gFrameCount); + LLStatViewer::FRAMETIME_JITTER.sample<LLTrace::Milliseconds>(mLastTimeDiff - time_diff); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - LLStatViewer::FRAMETIME_SLEW.sample(average_frametime - time_diff); - //setStat(ST_FRAMETIME_SLEW, - // (getStat(ST_FRAMETIME_SLEW) * (gFrameCount - 1) + - // fabs(average_frametime - time_diff) / average_frametime) / gFrameCount); + LLStatViewer::FRAMETIME_SLEW.sample<LLTrace::Milliseconds>(average_frametime - time_diff); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; LLStatViewer::DELTA_BANDWIDTH.sample<LLTrace::Bits>(delta_bandwidth); - //setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); - LLStatViewer::MAX_BANDWIDTH.sample<LLTrace::Bits>(max_bandwidth); - //setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f); - } mLastTimeDiff = time_diff; @@ -299,10 +280,13 @@ F32 gAveLandCompression = 0.f, gAveWaterCompression = 0.f; F32 gBestLandCompression = 1.f, gBestWaterCompression = 1.f; F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -U32 gTotalWorldBytes = 0, gTotalObjectBytes = 0, gTotalTextureBytes = 0, gSimPingCount = 0; -U32 gObjectBits = 0; +LLUnit::Bytes<U32> gTotalWorldData = 0, + gTotalObjectData = 0, + gTotalTextureData = 0; +U32 gSimPingCount = 0; +LLUnit::Bits<U32> gObjectData = 0; F32 gAvgSimPing = 0.f; -U32 gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; @@ -311,8 +295,8 @@ LLFrameTimer gTextureTimer; void update_statistics() { - gTotalWorldBytes += gVLManager.getTotalBytes(); - gTotalObjectBytes += gObjectBits / 8; + gTotalWorldData += gVLManager.getTotalBytes(); + gTotalObjectData += gObjectData; // make sure we have a valid time delta for this frame if (gFrameIntervalSeconds > 0.f) @@ -320,68 +304,48 @@ void update_statistics() if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) { LLStatViewer::MOUSELOOK_TIME.add(gFrameIntervalSeconds); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); } else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) { LLStatViewer::AVATAR_EDIT_TIME.add(gFrameIntervalSeconds); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); } else if (LLFloaterReg::instanceVisible("build")) { LLStatViewer::TOOLBOX_TIME.add(gFrameIntervalSeconds); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); } } LLStatViewer::ENABLE_VBO.sample((F64)gSavedSettings.getBOOL("RenderVBOEnable")); - //stats.setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); LLStatViewer::LIGHTING_DETAIL.sample((F64)gPipeline.getLightingDetail()); - //stats.setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); LLStatViewer::DRAW_DISTANCE.sample((F64)gSavedSettings.getF32("RenderFarClip")); - //stats.setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); LLStatViewer::CHAT_BUBBLES.sample((F64)gSavedSettings.getBOOL("UseChatBubbles")); - //stats.setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); - LLStatViewer::FRAME_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Frame")); - //stats.setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime("Frame")); + LLStatViewer::FRAME_STACKTIME.sample<LLTrace::Seconds>(gDebugView->mFastTimerView->getTime("Frame")); F64 idle_secs = gDebugView->mFastTimerView->getTime("Idle"); F64 network_secs = gDebugView->mFastTimerView->getTime("Network"); - LLStatViewer::UPDATE_STACKTIME.sample(idle_secs - network_secs); - //stats.setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); - LLStatViewer::NETWORK_STACKTIME.sample(network_secs); - //stats.setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); - LLStatViewer::IMAGE_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Update Images")); - //stats.setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime("Update Images")); - LLStatViewer::REBUILD_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Sort Draw State")); - //stats.setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime("Sort Draw State")); - LLStatViewer::RENDER_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Geometry")); - //stats.setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime("Geometry")); + LLStatViewer::UPDATE_STACKTIME.sample<LLTrace::Seconds>(idle_secs - network_secs); + LLStatViewer::NETWORK_STACKTIME.sample<LLTrace::Seconds>(network_secs); + LLStatViewer::IMAGE_STACKTIME.sample<LLTrace::Seconds>(gDebugView->mFastTimerView->getTime("Update Images")); + LLStatViewer::REBUILD_STACKTIME.sample<LLTrace::Seconds>(gDebugView->mFastTimerView->getTime("Sort Draw State")); + LLStatViewer::RENDER_STACKTIME.sample<LLTrace::Seconds>(gDebugView->mFastTimerView->getTime("Geometry")); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(cdp->getPingDelay()); - //stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(10000); - //stats.mSimPingStat.addValue(10000); } - //stats.mFPSStat.addValue(1); LLStatViewer::FPS.add(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); LLStatViewer::LAYERS_KBIT.add<LLTrace::Bits>(layer_bits); - //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - LLStatViewer::OBJECT_KBIT.add<LLTrace::Bits>(gObjectBits); - //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); - //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); + LLStatViewer::OBJECT_KBIT.add(gObjectData); LLStatViewer::PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); LLStatViewer::ASSET_KBIT.add<LLTrace::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); - //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -403,14 +367,13 @@ void update_statistics() avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; } LLStatViewer::VISIBLE_AVATARS.sample((F64)avg_visible_avatars); - //stats.setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); } LLWorld::getInstance()->updateNetStats(); LLWorld::getInstance()->requestCacheMisses(); // Reset all of these values. gVLManager.resetBitCounts(); - gObjectBits = 0; + gObjectData = 0; // gDecodedBits = 0; // Only update texture stats periodically so that they are less noisy @@ -419,7 +382,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureBytes = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); texture_stats_timer.reset(); } } @@ -559,9 +522,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = gTotalWorldBytes / 1024.0; - download["object_kbytes"] = gTotalObjectBytes / 1024.0; - download["texture_kbytes"] = gTotalTextureBytes / 1024.0; + download["world_kbytes"] = LLTrace::Kilobytes(gTotalWorldData).value(); + download["object_kbytes"] = LLTrace::Kilobytes(gTotalObjectData).value(); + download["texture_kbytes"] = LLTrace::Kilobytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index b182a40403..06f65b2cdd 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -57,7 +57,7 @@ struct SimMeasurement : public LLTrace::Measurement<T>, public SimMeasurementSam /*virtual*/ void sample(F64 value) { - LLTrace::Measurement<T>::sample(value); + LLTrace::Measurement<T>::sample(T(value)); } }; @@ -318,7 +318,7 @@ void update_statistics(); void send_stats(); extern LLFrameTimer gTextureTimer; -extern U32 gTotalTextureBytes; -extern U32 gTotalObjectBytes; -extern U32 gTotalTextureBytesPerBoostLevel[] ; +extern LLUnit::Bytes<U32> gTotalTextureData; +extern LLUnit::Bytes<U32> gTotalObjectData; +extern LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[] ; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d355432e8a..b9d5751412 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -709,7 +709,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() // Update the decode priority for N images each frame { static const S32 MAX_PRIO_UPDATES = gSavedSettings.getS32("TextureFetchUpdatePriorities"); // default: 32 - const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds) + 1, MAX_PRIO_UPDATES); + const size_t max_update_count = llmin((S32) (MAX_PRIO_UPDATES*MAX_PRIO_UPDATES*gFrameIntervalSeconds.value()) + 1, MAX_PRIO_UPDATES); S32 update_counter = llmin(max_update_count, mUUIDMap.size()); uuid_map_t::iterator iter = mUUIDMap.upper_bound(mLastUpdateUUID); while ((update_counter-- > 0) && !mUUIDMap.empty()) @@ -943,11 +943,11 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) static const F32 MIN_PRIORITY_THRESHOLD = gSavedSettings.getF32("TextureFetchUpdatePriorityThreshold"); // default: 0.0 static const bool SKIP_LOW_PRIO = gSavedSettings.getBOOL("TextureFetchUpdateSkipLowPriority"); // default: false - size_t max_priority_count = llmin((S32) (MAX_HIGH_PRIO_COUNT*MAX_HIGH_PRIO_COUNT*gFrameIntervalSeconds)+1, MAX_HIGH_PRIO_COUNT); + size_t max_priority_count = llmin((S32) (MAX_HIGH_PRIO_COUNT*MAX_HIGH_PRIO_COUNT*gFrameIntervalSeconds.value())+1, MAX_HIGH_PRIO_COUNT); max_priority_count = llmin(max_priority_count, mImageList.size()); size_t total_update_count = mUUIDMap.size(); - size_t max_update_count = llmin((S32) (MAX_UPDATE_COUNT*MAX_UPDATE_COUNT*gFrameIntervalSeconds)+1, MAX_UPDATE_COUNT); + size_t max_update_count = llmin((S32) (MAX_UPDATE_COUNT*MAX_UPDATE_COUNT*gFrameIntervalSeconds.value())+1, MAX_UPDATE_COUNT); max_update_count = llmin(max_update_count, total_update_count); // MAX_HIGH_PRIO_COUNT high priority entries diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2062f07650..06daf15c08 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -731,7 +731,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, (F32)gTotalTextureBytesPerBoostLevel[i] / (1024 * 1024))); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit::Megabytes<F32>(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } @@ -1405,8 +1405,8 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); temp_str = llformat( "FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ recording.getPerSec(LLStatViewer::FPS), //mFPSStat.getMeanPerSec(), - recording.getMean(LLStatViewer::SIM_PHYSICS_FPS), //LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), - recording.getMean(LLStatViewer::SIM_TIME_DILATION)); //LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); + recording.getLastValue(LLStatViewer::SIM_PHYSICS_FPS), + recording.getLastValue(LLStatViewer::SIM_TIME_DILATION)); S32 len = temp_str.length(); TextOutA(hdc, 0, 0, temp_str.c_str(), len); @@ -2185,9 +2185,7 @@ void LLViewerWindow::reshape(S32 width, S32 height) } LLStatViewer::WINDOW_WIDTH.sample((F64)width); - //LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); LLStatViewer::WINDOW_HEIGHT.sample((F64)height); - //LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height); LLLayoutStack::updateClass(); } @@ -3237,8 +3235,8 @@ void LLViewerWindow::updateMouseDelta() static F32 fdy = 0.f; F32 amount = 16.f; - fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds*amount,1.f); - fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds*amount,1.f); + fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f); + fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f); mCurrentMouseDelta.set(llround(fdx), llround(fdy)); mouse_vel.setVec(fdx,fdy); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d366455a62..97c1b07ebc 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7813,14 +7813,14 @@ void LLVOAvatar::cullAvatarsByPixelArea() if (gFrameTimeSeconds != sUnbakedUpdateTime) // only update once per frame { sUnbakedUpdateTime = gFrameTimeSeconds; - sUnbakedTime += gFrameIntervalSeconds; + sUnbakedTime += gFrameIntervalSeconds.value(); } if (grey_avatars > 0) { if (gFrameTimeSeconds != sGreyUpdateTime) // only update once per frame { sGreyUpdateTime = gFrameTimeSeconds; - sGreyTime += gFrameIntervalSeconds; + sGreyTime += gFrameIntervalSeconds.value(); } } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9f0921ff59..7c20e8eae7 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -910,18 +910,11 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (mLastRegionHandle != 0) { ++mRegionCrossingCount; - F64 delta = (F64)mRegionCrossingTimer.getElapsedTimeF32(); - //F64 avg = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_AVG); - //F64 delta_avg = (delta + avg*(mRegionCrossingCount-1)) / mRegionCrossingCount; + LLTrace::Seconds delta = mRegionCrossingTimer.getElapsedTimeF32(); LLStatViewer::REGION_CROSSING_TIME.sample(delta); - //LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg); - // - //F64 max = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_MAX); - //max = llmax(delta, max); - //LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_MAX, max); // Diagnostics - llinfos << "Region crossing took " << (F32)(delta * 1000.0) << " ms " << llendl; + llinfos << "Region crossing took " << (F32)(delta * 1000.0).value() << " ms " << llendl; } if (regionp) { @@ -2589,7 +2582,6 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) gAgentAvatarp->invalidateComposite(layer_set, TRUE); found = TRUE; LLStatViewer::TEX_REBAKES.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } } } @@ -2635,7 +2627,6 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) invalidateComposite(layer_set, TRUE); LLStatViewer::TEX_REBAKES.add(1); - //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } else { diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 20033d6fe4..0eb00f7191 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -136,7 +136,6 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { LLFile::remove(std::string(filename)); } - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); LL_WARNS("Wearable") << "Wearable download failed: " << LLAssetStorage::getErrorString( status ) << " " << uuid << LL_ENDL; switch( status ) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4582de805f..75af605ad7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4892,7 +4892,7 @@ void LLPipeline::renderDebug() { DebugBlip& blip = *iter; - blip.mAge += gFrameIntervalSeconds; + blip.mAge += gFrameIntervalSeconds.value(); if (blip.mAge > 2.f) { mDebugBlips.erase(iter++); @@ -4902,7 +4902,7 @@ void LLPipeline::renderDebug() iter++; } - blip.mPosition.mV[2] += gFrameIntervalSeconds*2.f; + blip.mPosition.mV[2] += gFrameIntervalSeconds.value()*2.f; gGL.color4fv(blip.mColor.mV); gGL.vertex3fv(blip.mPosition.mV); @@ -5713,7 +5713,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera) { if (farthest_light->fade >= 0.f) { - farthest_light->fade = -gFrameIntervalSeconds; + farthest_light->fade = -(gFrameIntervalSeconds.value()); } } else @@ -5809,12 +5809,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) if (fade >= 0.f) { fade = fade / LIGHT_FADE_TIME; - ((Light*) (&(*iter)))->fade += gFrameIntervalSeconds; + ((Light*) (&(*iter)))->fade += gFrameIntervalSeconds.value(); } else { fade = 1.f + fade / LIGHT_FADE_TIME; - ((Light*) (&(*iter)))->fade -= gFrameIntervalSeconds; + ((Light*) (&(*iter)))->fade -= gFrameIntervalSeconds.value(); } fade = llclamp(fade,0.f,1.f); light_color *= fade; @@ -7129,7 +7129,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) } else if (transition_time < 1.f) { //currently in a transition, continue interpolating - transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds; + transition_time += 1.f/CameraFocusTransitionTime*gFrameIntervalSeconds.value(); transition_time = llmin(transition_time, 1.f); F32 t = cosf(transition_time*F_PI+F_PI)*0.5f+0.5f; @@ -9121,7 +9121,7 @@ void LLPipeline::generateHighlight(LLCamera& camera) if (!mHighlightSet.empty()) { - F32 transition = gFrameIntervalSeconds/RenderHighlightFadeTime; + F32 transition = gFrameIntervalSeconds.value()/RenderHighlightFadeTime; LLGLDisable test(GL_ALPHA_TEST); LLGLDepthTest depth(GL_FALSE); @@ -9756,7 +9756,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) if (gen_shadow) { - F32 fade_amt = gFrameIntervalSeconds * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); + F32 fade_amt = gFrameIntervalSeconds.value() * llmax(LLViewerCamera::getInstance()->getVelocityStat()->getCurrentPerSec(), 1.f); //update shadow targets for (U32 i = 0; i < 2; i++) diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index f8923b9868..4a190fbe23 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -220,7 +220,18 @@ get_region(const LLSD & sd, U64 region_handle1) namespace tut { struct tst_viewerassetstats_index - {}; + { + tst_viewerassetstats_index() + { + LLTrace::init(); + } + + ~tst_viewerassetstats_index() + { + LLTrace::cleanup(); + } + + }; typedef test_group<tst_viewerassetstats_index> tst_viewerassetstats_index_t; typedef tst_viewerassetstats_index_t::object tst_viewerassetstats_index_object_t; tut::tst_viewerassetstats_index_t tut_tst_viewerassetstats_index("tst_viewerassetstats_test"); |