From b3e9c46c94dad0c81a5adcb9152521b5368c66a7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 Aug 2012 22:50:56 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages further cleanup of LLStat removed llfloaterlagmeter --- indra/newview/llviewerstats.cpp | 150 ++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 81 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 1d6d5b7e72..58a7b3a463 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -66,137 +66,134 @@ class StatAttributes { public: StatAttributes(const char* name, - const BOOL enabled, - const BOOL is_timer) + const BOOL enabled) : mName(name), - mEnabled(enabled), - mIsTimer(is_timer) + mEnabled(enabled) { } std::string mName; BOOL mEnabled; - BOOL mIsTimer; }; const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] = { // ST_VERSION - StatAttributes("Version", TRUE, FALSE), + StatAttributes("Version", TRUE), // ST_AVATAR_EDIT_SECONDS - StatAttributes("Seconds in Edit Appearence", FALSE, TRUE), + StatAttributes("Seconds in Edit Appearence", FALSE), // ST_TOOLBOX_SECONDS - StatAttributes("Seconds using Toolbox", FALSE, TRUE), + StatAttributes("Seconds using Toolbox", FALSE), // ST_CHAT_COUNT - StatAttributes("Chat messages sent", FALSE, FALSE), + StatAttributes("Chat messages sent", FALSE), // ST_IM_COUNT - StatAttributes("IMs sent", FALSE, FALSE), + StatAttributes("IMs sent", FALSE), // ST_FULLSCREEN_BOOL - StatAttributes("Fullscreen mode", FALSE, FALSE), + StatAttributes("Fullscreen mode", FALSE), // ST_RELEASE_COUNT - StatAttributes("Object release count", FALSE, FALSE), + StatAttributes("Object release count", FALSE), // ST_CREATE_COUNT - StatAttributes("Object create count", FALSE, FALSE), + StatAttributes("Object create count", FALSE), // ST_REZ_COUNT - StatAttributes("Object rez count", FALSE, FALSE), + StatAttributes("Object rez count", FALSE), // ST_FPS_10_SECONDS - StatAttributes("Seconds below 10 FPS", FALSE, TRUE), + StatAttributes("Seconds below 10 FPS", FALSE), // ST_FPS_2_SECONDS - StatAttributes("Seconds below 2 FPS", FALSE, TRUE), + StatAttributes("Seconds below 2 FPS", FALSE), // ST_MOUSELOOK_SECONDS - StatAttributes("Seconds in Mouselook", FALSE, TRUE), + StatAttributes("Seconds in Mouselook", FALSE), // ST_FLY_COUNT - StatAttributes("Fly count", FALSE, FALSE), + StatAttributes("Fly count", FALSE), // ST_TELEPORT_COUNT - StatAttributes("Teleport count", FALSE, FALSE), + StatAttributes("Teleport count", FALSE), // ST_OBJECT_DELETE_COUNT - StatAttributes("Objects deleted", FALSE, FALSE), + StatAttributes("Objects deleted", FALSE), // ST_SNAPSHOT_COUNT - StatAttributes("Snapshots taken", FALSE, FALSE), + StatAttributes("Snapshots taken", FALSE), // ST_UPLOAD_SOUND_COUNT - StatAttributes("Sounds uploaded", FALSE, FALSE), + StatAttributes("Sounds uploaded", FALSE), // ST_UPLOAD_TEXTURE_COUNT - StatAttributes("Textures uploaded", FALSE, FALSE), + StatAttributes("Textures uploaded", FALSE), // ST_EDIT_TEXTURE_COUNT - StatAttributes("Changes to textures on objects", FALSE, FALSE), + StatAttributes("Changes to textures on objects", FALSE), // ST_KILLED_COUNT - StatAttributes("Number of times killed", FALSE, FALSE), + StatAttributes("Number of times killed", FALSE), // ST_FRAMETIME_JITTER - StatAttributes("Average delta between sucessive frame times", FALSE, FALSE), + StatAttributes("Average delta between successive frame times", FALSE), // ST_FRAMETIME_SLEW - StatAttributes("Average delta between frame time and mean", FALSE, FALSE), + StatAttributes("Average delta between frame time and mean", FALSE), // ST_INVENTORY_TOO_LONG - StatAttributes("Inventory took too long to load", FALSE, FALSE), + StatAttributes("Inventory took too long to load", FALSE), // ST_WEARABLES_TOO_LONG - StatAttributes("Wearables took too long to load", FALSE, FALSE), + StatAttributes("Wearables took too long to load", FALSE), // ST_LOGIN_SECONDS - StatAttributes("Time between LoginRequest and LoginReply", FALSE, FALSE), + StatAttributes("Time between LoginRequest and LoginReply", FALSE), // ST_LOGIN_TIMEOUT_COUNT - StatAttributes("Number of login attempts that timed out", FALSE, FALSE), + StatAttributes("Number of login attempts that timed out", FALSE), // ST_HAS_BAD_TIMER - StatAttributes("Known bad timer if != 0.0", FALSE, FALSE), + StatAttributes("Known bad timer if != 0.0", FALSE), // ST_DOWNLOAD_FAILED - StatAttributes("Number of times LLAssetStorage::getAssetData() has failed", FALSE, FALSE), + StatAttributes("Number of times LLAssetStorage::getAssetData() has failed", FALSE), // ST_LSL_SAVE_COUNT - StatAttributes("Number of times user has saved a script", FALSE, FALSE), + StatAttributes("Number of times user has saved a script", FALSE), // ST_UPLOAD_ANIM_COUNT - StatAttributes("Animations uploaded", FALSE, FALSE), + StatAttributes("Animations uploaded", FALSE), // ST_FPS_8_SECONDS - StatAttributes("Seconds below 8 FPS", FALSE, TRUE), + StatAttributes("Seconds below 8 FPS", FALSE), // ST_SIM_FPS_20_SECONDS - StatAttributes("Seconds with sim FPS below 20", FALSE, TRUE), + StatAttributes("Seconds with sim FPS below 20", FALSE), // ST_PHYS_FPS_20_SECONDS - StatAttributes("Seconds with physics FPS below 20", FALSE, TRUE), + StatAttributes("Seconds with physics FPS below 20", FALSE), // ST_LOSS_05_SECONDS - StatAttributes("Seconds with packet loss > 5%", FALSE, TRUE), + StatAttributes("Seconds with packet loss > 5%", FALSE), // ST_FPS_DROP_50_RATIO - StatAttributes("Ratio of frames 2x longer than previous", FALSE, FALSE), + StatAttributes("Ratio of frames 2x longer than previous", FALSE), // ST_ENABLE_VBO - StatAttributes("Vertex Buffers Enabled", TRUE, FALSE), + StatAttributes("Vertex Buffers Enabled", TRUE), // ST_DELTA_BANDWIDTH - StatAttributes("Increase/Decrease in bandwidth based on packet loss", FALSE, FALSE), + StatAttributes("Increase/Decrease in bandwidth based on packet loss", FALSE), // ST_MAX_BANDWIDTH - StatAttributes("Max bandwidth setting", FALSE, FALSE), + StatAttributes("Max bandwidth setting", FALSE), // ST_LIGHTING_DETAIL - StatAttributes("Lighting Detail", FALSE, FALSE), + StatAttributes("Lighting Detail", FALSE), // ST_VISIBLE_AVATARS - StatAttributes("Visible Avatars", FALSE, FALSE), + StatAttributes("Visible Avatars", FALSE), // ST_SHADER_OJECTS - StatAttributes("Object Shaders", FALSE, FALSE), + StatAttributes("Object Shaders", FALSE), // ST_SHADER_ENVIRONMENT - StatAttributes("Environment Shaders", FALSE, FALSE), + StatAttributes("Environment Shaders", FALSE), // ST_VISIBLE_DRAW_DIST - StatAttributes("Draw Distance", FALSE, FALSE), + StatAttributes("Draw Distance", FALSE), // ST_VISIBLE_CHAT_BUBBLES - StatAttributes("Chat Bubbles Enabled", FALSE, FALSE), + StatAttributes("Chat Bubbles Enabled", FALSE), // ST_SHADER_AVATAR - StatAttributes("Avatar Shaders", FALSE, FALSE), + StatAttributes("Avatar Shaders", FALSE), // ST_FRAME_SECS - StatAttributes("FRAME_SECS", FALSE, FALSE), + StatAttributes("FRAME_SECS", FALSE), // ST_UPDATE_SECS - StatAttributes("UPDATE_SECS", FALSE, FALSE), + StatAttributes("UPDATE_SECS", FALSE), // ST_NETWORK_SECS - StatAttributes("NETWORK_SECS", FALSE, FALSE), + StatAttributes("NETWORK_SECS", FALSE), // ST_IMAGE_SECS - StatAttributes("IMAGE_SECS", FALSE, FALSE), + StatAttributes("IMAGE_SECS", FALSE), // ST_REBUILD_SECS - StatAttributes("REBUILD_SECS", FALSE, FALSE), + StatAttributes("REBUILD_SECS", FALSE), // ST_RENDER_SECS - StatAttributes("RENDER_SECS", FALSE, FALSE), + StatAttributes("RENDER_SECS", FALSE), // ST_CROSSING_AVG - StatAttributes("CROSSING_AVG", FALSE, FALSE), + StatAttributes("CROSSING_AVG", FALSE), // ST_CROSSING_MAX - StatAttributes("CROSSING_MAX", FALSE, FALSE), + StatAttributes("CROSSING_MAX", FALSE), // ST_LIBXUL_WIDGET_USED - StatAttributes("LibXUL Widget used", FALSE, FALSE), // Unused + StatAttributes("LibXUL Widget used", FALSE), // Unused // ST_WINDOW_WIDTH - StatAttributes("Window width", FALSE, FALSE), + StatAttributes("Window width", FALSE), // ST_WINDOW_HEIGHT - StatAttributes("Window height", FALSE, FALSE), + StatAttributes("Window height", FALSE), // ST_TEX_BAKES - StatAttributes("Texture Bakes", FALSE, FALSE), + StatAttributes("Texture Bakes", FALSE), // ST_TEX_REBAKES - StatAttributes("Texture Rebakes", FALSE, FALSE) + StatAttributes("Texture Rebakes", FALSE) }; @@ -207,16 +204,11 @@ LLViewerStats::LLViewerStats() : mAssetKBitStat("assetkbitstat"), mTextureKBitStat("texturekbitstat"), mVFSPendingOperations("vfspendingoperations"), - mObjectsDrawnStat("objectsdrawnstat"), - mObjectsCulledStat("objectsculledstat"), - mObjectsTestedStat("objectstestedstat"), - mObjectsComparedStat("objectscomparedstat"), - mObjectsOccludedStat("objectsoccludedstat"), mFPSStat("fpsstat"), mPacketsInStat("packetsinstat"), mPacketsLostStat("packetsloststat"), mPacketsOutStat("packetsoutstat"), - mPacketsLostPercentStat("packetslostpercentstat", 64), + mPacketsLostPercentStat("packetslostpercentstat"), mTexturePacketsStat("texturepacketsstat"), mActualInKBitStat("actualinkbitstat"), mActualOutKBitStat("actualoutkbitstat"), @@ -258,12 +250,12 @@ LLViewerStats::LLViewerStats() : mPhysicsLODTasks("physicslodtasks"), mPhysicsMemoryAllocated("physicsmemoryallocated"), mSimPingStat("simpingstat"), - mNumImagesStat("numimagesstat", 32, TRUE), - mNumRawImagesStat("numrawimagesstat", 32, TRUE), - mGLTexMemStat("gltexmemstat", 32, TRUE), - mGLBoundMemStat("glboundmemstat", 32, TRUE), - mRawMemStat("rawmemstat", 32, TRUE), - mFormattedMemStat("formattedmemstat", 32, TRUE), + mNumImagesStat("numimagesstat", TRUE), + mNumRawImagesStat("numrawimagesstat", TRUE), + mGLTexMemStat("gltexmemstat", TRUE), + mGLBoundMemStat("glboundmemstat", TRUE), + mRawMemStat("rawmemstat", TRUE), + mFormattedMemStat("formattedmemstat", TRUE), mNumObjectsStat("numobjectsstat"), mNumActiveObjectsStat("numactiveobjectsstat"), mNumNewObjectsStat("numnewobjectsstat"), @@ -284,10 +276,6 @@ LLViewerStats::LLViewerStats() : mAgentPositionSnaps.reset(); } -LLViewerStats::~LLViewerStats() -{ -} - void LLViewerStats::resetStats() { LLViewerStats& stats = LLViewerStats::instance(); @@ -398,7 +386,7 @@ void LLViewerStats::addToMessage(LLSD &body) const } } - body["AgentPositionSnaps"] = mAgentPositionSnaps.getData(); + body["AgentPositionSnaps"] = mAgentPositionSnaps.asLLSD(); llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev() << "; Count = " << mAgentPositionSnaps.getCount() << llendl; } @@ -783,7 +771,7 @@ void LLViewerStats::PhaseMap::clearPhases() mPhaseMap.clear(); } -LLSD LLViewerStats::PhaseMap::dumpPhases() +LLSD LLViewerStats::PhaseMap::asLLSD() { LLSD result; for (phase_map_t::iterator iter = mPhaseMap.begin(); iter != mPhaseMap.end(); ++iter) -- cgit v1.2.3 From b1baf982b1bd41a150233d0a28d3601226924c65 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 30 Sep 2012 10:41:29 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages factored out lltrace::sampler into separate file added rudimentary lltrace support to llstatgraph made llstatgraph use param blocks more effectively moves initial set of stats over to lltrace removed windows.h #defines for min and max --- indra/newview/llviewerstats.cpp | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index da87cc2673..b1aeaef91d 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -62,6 +62,13 @@ #include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived +LLTrace::Stat STAT_KBIT("kbitstat"), + STAT_LAYERS_KBIT("layerskbitstat"), + STAT_OBJECT_KBIT("objectkbitstat"), + STAT_ASSET_KBIT("assetkbitstat"), + STAT_TEXTURE_KBIT("texturekbitstat"); + + class StatAttributes { public: @@ -198,11 +205,6 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] = }; LLViewerStats::LLViewerStats() : - mKBitStat("kbitstat"), - mLayersKBitStat("layerskbitstat"), - mObjectKBitStat("objectkbitstat"), - mAssetKBitStat("assetkbitstat"), - mTextureKBitStat("texturekbitstat"), mVFSPendingOperations("vfspendingoperations"), mFPSStat("fpsstat"), mPacketsInStat("packetsinstat"), @@ -261,7 +263,8 @@ LLViewerStats::LLViewerStats() : mNumNewObjectsStat("numnewobjectsstat"), mNumSizeCulledStat("numsizeculledstat"), mNumVisCulledStat("numvisculledstat"), - mLastTimeDiff(0.0) + mLastTimeDiff(0.0), + mSampler(LLThread::getTraceData()->createSampler()) { for (S32 i = 0; i < ST_COUNT; i++) { @@ -274,17 +277,18 @@ LLViewerStats::LLViewerStats() : } mAgentPositionSnaps.reset(); + mSampler->start(); +} + +LLViewerStats::~LLViewerStats() +{ + delete mSampler; } void LLViewerStats::resetStats() { LLViewerStats& stats = LLViewerStats::instance(); - stats.mKBitStat.reset(); - stats.mLayersKBitStat.reset(); - stats.mObjectKBitStat.reset(); - stats.mTextureKBitStat.reset(); stats.mVFSPendingOperations.reset(); - stats.mAssetKBitStat.reset(); stats.mPacketsInStat.reset(); stats.mPacketsLostStat.reset(); stats.mPacketsOutStat.reset(); @@ -463,10 +467,13 @@ void update_statistics() stats.mFPSStat.addValue(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - stats.mLayersKBitStat.addValue(layer_bits/1024.f); - stats.mObjectKBitStat.addValue(gObjectBits/1024.f); + STAT_LAYERS_KBIT.sample(layer_bits/1024.f); + //stats.mLayersKBitStat.addValue(layer_bits/1024.f); + STAT_OBJECT_KBIT.sample(gObjectBits/1024.f); + //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); - stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + STAT_ASSET_KBIT.sample(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -503,7 +510,8 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); + STAT_TEXTURE_KBIT.sample(LLViewerTextureList::sTextureBits/1024.f); + //stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets); gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8; LLViewerTextureList::sTextureBits = 0; -- cgit v1.2.3 From 14b1b0b2bb6bac5bc688cc4d14c33f1b680dd3b4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 1 Oct 2012 19:39:04 -0700 Subject: SH-3275 WIP Run viewer metrics for object update messages cleaned up API samplers are now value types with copy-on-write buffers under the hood removed coupling with LLThread --- indra/newview/llviewerstats.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index b1aeaef91d..e2b09a1902 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -62,7 +62,7 @@ #include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived -LLTrace::Stat STAT_KBIT("kbitstat"), +LLTrace::Rate STAT_KBIT("kbitstat"), STAT_LAYERS_KBIT("layerskbitstat"), STAT_OBJECT_KBIT("objectkbitstat"), STAT_ASSET_KBIT("assetkbitstat"), @@ -263,8 +263,7 @@ LLViewerStats::LLViewerStats() : mNumNewObjectsStat("numnewobjectsstat"), mNumSizeCulledStat("numsizeculledstat"), mNumVisCulledStat("numvisculledstat"), - mLastTimeDiff(0.0), - mSampler(LLThread::getTraceData()->createSampler()) + mLastTimeDiff(0.0) { for (S32 i = 0; i < ST_COUNT; i++) { @@ -467,12 +466,12 @@ void update_statistics() stats.mFPSStat.addValue(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - STAT_LAYERS_KBIT.sample(layer_bits/1024.f); + STAT_LAYERS_KBIT.add(layer_bits/1024.f); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - STAT_OBJECT_KBIT.sample(gObjectBits/1024.f); + STAT_OBJECT_KBIT.add(gObjectBits/1024.f); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); - STAT_ASSET_KBIT.sample(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + STAT_ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -510,7 +509,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - STAT_TEXTURE_KBIT.sample(LLViewerTextureList::sTextureBits/1024.f); + STAT_TEXTURE_KBIT.add(LLViewerTextureList::sTextureBits/1024.f); //stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets); gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8; -- cgit v1.2.3 From dbe9742703cf14db85ec3d16c540efc68dce95a6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 2 Oct 2012 15:37:16 -0700 Subject: SH-3404 create sampler class renamed LLTrace::ThreadTrace to LLTrace::ThreadRecorder renamed LLTrace::Sampler to LLTrace::Recording --- indra/newview/llviewerstats.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index e2b09a1902..a6e9643edd 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -276,12 +276,11 @@ LLViewerStats::LLViewerStats() : } mAgentPositionSnaps.reset(); - mSampler->start(); + mRecording.start(); } LLViewerStats::~LLViewerStats() { - delete mSampler; } void LLViewerStats::resetStats() -- cgit v1.2.3 From 8f5e83789254d19a1a31737b0d7515cd7e967b26 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 3 Oct 2012 19:32:59 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system SH-3403 FIX implement unit conversion LLUnit implements unit tracking and conversion added support for LLUnit to LLTrace duplicated most llstats into LLTrace equivalents --- indra/newview/llviewerstats.cpp | 131 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 119 insertions(+), 12 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index a6e9643edd..954fa24eaa 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -61,21 +61,128 @@ #include "llviewernetwork.h" #include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived +namespace LLStatViewer +{ -LLTrace::Rate STAT_KBIT("kbitstat"), - STAT_LAYERS_KBIT("layerskbitstat"), - STAT_OBJECT_KBIT("objectkbitstat"), - STAT_ASSET_KBIT("assetkbitstat"), - STAT_TEXTURE_KBIT("texturekbitstat"); - +LLTrace::Rate FPS("fpsstat"), + PACKETS_IN("packetsinstat"), + PACKETS_LOST("packetsloststat"), + PACKETS_OUT("packetsoutstat"), + TEXTURE_PACKETS("texturepacketsstat"), + TRIANGLES_DRAWN("trianglesdrawnstat"), + CHAT_COUNT("chatcount"), + IM_COUNT("imcount"), + OBJECT_CREATE("objectcreate"), + OBJECT_REZ("objectrez"), + LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay"), + LOGIN_TIMEOUTS("logintimeouts"), + FAILED_DOWNLOADS("faileddownloads"), + LSL_SAVES("lslsaves"), + ANIMATION_UPLOADS("animationuploads"), + FLY("fly"), + TELEPORT("teleport"), + DELETE_OBJECT("deleteobject"), + SNAPSHOT("snapshot"), + UPLOAD_SOUND("uploadsound"), + UPLOAD_TEXTURE("uploadtexture"), + EDIT_TEXTURE("edittexture"), + KILLED("killed"), + FRAMETIME_DOUBLED("frametimedoubled"), + TEX_BAKES("texbakes"), + TEX_REBAKES("texrebakes"); +LLTrace::Rate > KBIT("kbitstat"), + LAYERS_KBIT("layerskbitstat"), + OBJECT_KBIT("objectkbitstat"), + ASSET_KBIT("assetkbitstat"), + TEXTURE_KBIT("texturekbitstat"), + ACTUAL_IN_KBIT("actualinkbit"), + ACTUAL_OUT_KBIT("actualoutkbit"); + +LLTrace::Rate > AVATAR_EDIT_TIME("avataredittimr"), + TOOLBOX_TIME("toolboxtime"), + MOUSELOOK_TIME("mouselooktime"), + FPS_10_TIME("fps10time"), + FPS_8_TIME("fps8time"), + FPS_2_TIME("fps2time"), + SIM_20_FPS_TIME("sim20fpstime"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime"), + LOSS_5_PERCENT_TIME("loss5percenttime"); + +LLTrace::Measurement SIM_TIME_DILATION("simtimedilation"), + SIM_FPS("simfps"), + SIM_PHYSICS_FPS("simphysicsfps"), + SIM_AGENT_UPS("simagentups"), + SIM_SCRIPT_EPS("simscripteps"), + SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps"), + SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters"), + SIM_MAIN_AGENTS("simmainagents"), + SIM_CHILD_AGENTS("simchildagents"), + SIM_OBJECTS("simobjects"), + SIM_ACTIVE_OBJECTS("simactiveobjects"), + SIM_ACTIVE_SCRIPTS("simactivescripts"), + SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun"), + SIM_IN_PACKETS_PER_SEC("siminpps"), + SIM_OUT_PACKETS_PER_SEC("simoutpps"), + SIM_PENDING_DOWNLOADS("simpendingdownloads"), + SIM_PENDING_UPLOADS("simpendinguploads"), + SIM_PENING_LOCAL_UPLOADS("simpendinglocaluploads"), + SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks"), + SIM_PHYSICS_LOD_TASKS("physicslodtasks"), + NUM_IMAGES("numimagesstat"), + NUM_RAW_IMAGES("numrawimagesstat"), + NUM_OBJECTS("numobjectsstat"), + NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), + NUM_NEW_OBJECTS("numnewobjectsstat"), + NUM_SIZE_CULLED("numsizeculledstat"), + NUM_VIS_CULLED("numvisculledstat"), + ENABLE_VBO("enablevbo"), + DELTA_BANDWIDTH("deltabandwidth"), + MAX_BANDWIDTH("maxbandwidth"), + LIGHTING_DETAIL("lightingdetail"), + VISIBLE_AVATARS("visibleavatars"), + SHADER_OBJECTS("shaderobjects"), + DRAW_DISTANCE("drawdistance"), + CHAT_BUBBLES("chatbubbles"), + WINDOW_WIDTH("windowwidth"), + WINDOW_HEIGHT("windowheight"); + +LLTrace::Measurement > SIM_UNACKED_BYTES("simtotalunackedbytes"), + SIM_PHYSICS_MEM("physicsmemoryallocated"), + GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"); + + +LLTrace::Measurement > SIM_PHYSICS_TIME("simsimphysicsmsec"), + SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec"), + SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec"), + SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec"), + SIM_AI_TIME("simsimaistepmsec"), + SIM_AGENTS_TIME("simagentmsec"), + SIM_IMAGES_TIME("simimagesmsec"), + SIM_SCRIPTS_TIME("simscriptmsec"), + SIM_SPARE_TIME("simsparemsec"), + SIM_SLEEP_TIME("simsleepmsec"), + SIM_PUMP_IO_TIME("simpumpiomsec"), + SIM_PING("simpingstat"), + LOGIN_SECONDS("loginseconds"), + REGION_CROSSING_TIME("regioncrossingtime"), + FRAME_STACKTIME("framestacktime"), + UPDATE_STACKTIME("updatestacktime"), + NETWORK_STACKTIME("networkstacktime"), + IMAGE_STACKTIME("imagestacktime"), + REBUILD_STACKTIME("rebuildstacktime"), + RENDER_STACKTIME("renderstacktime"); +} class StatAttributes { public: StatAttributes(const char* name, const BOOL enabled) - : mName(name), - mEnabled(enabled) + : mName(name), + mEnabled(enabled) { } @@ -465,12 +572,12 @@ void update_statistics() stats.mFPSStat.addValue(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - STAT_LAYERS_KBIT.add(layer_bits/1024.f); + LLStatViewer::LAYERS_KBIT.add >(layer_bits); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - STAT_OBJECT_KBIT.add(gObjectBits/1024.f); + LLStatViewer::OBJECT_KBIT.add >(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); - STAT_ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + LLStatViewer::ASSET_KBIT.add >(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -508,7 +615,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - STAT_TEXTURE_KBIT.add(LLViewerTextureList::sTextureBits/1024.f); + LLStatViewer::TEXTURE_KBIT.add >(LLViewerTextureList::sTextureBits); //stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets); gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8; -- cgit v1.2.3 From 74ac0182ec8f7a0f6d0ea89f5814f0998ab90b62 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Oct 2012 19:25:56 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed units conversion so that trace getters return convertable units removed circular dependencies from lltrace* converted more stats to lltrace --- indra/newview/llviewerstats.cpp | 349 +++++++++++++--------------------------- 1 file changed, 111 insertions(+), 238 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 954fa24eaa..2737d24674 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -64,32 +64,32 @@ namespace LLStatViewer { -LLTrace::Rate FPS("fpsstat"), - PACKETS_IN("packetsinstat"), - PACKETS_LOST("packetsloststat"), - PACKETS_OUT("packetsoutstat"), - TEXTURE_PACKETS("texturepacketsstat"), - TRIANGLES_DRAWN("trianglesdrawnstat"), - CHAT_COUNT("chatcount"), - IM_COUNT("imcount"), - OBJECT_CREATE("objectcreate"), - OBJECT_REZ("objectrez"), - LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay"), - LOGIN_TIMEOUTS("logintimeouts"), - FAILED_DOWNLOADS("faileddownloads"), - LSL_SAVES("lslsaves"), - ANIMATION_UPLOADS("animationuploads"), - FLY("fly"), - TELEPORT("teleport"), - DELETE_OBJECT("deleteobject"), - SNAPSHOT("snapshot"), - UPLOAD_SOUND("uploadsound"), - UPLOAD_TEXTURE("uploadtexture"), - EDIT_TEXTURE("edittexture"), - KILLED("killed"), - FRAMETIME_DOUBLED("frametimedoubled"), - TEX_BAKES("texbakes"), - TEX_REBAKES("texrebakes"); +LLTrace::Rate FPS("fpsstat"), + PACKETS_IN("packetsinstat"), + PACKETS_LOST("packetsloststat"), + PACKETS_OUT("packetsoutstat"), + TEXTURE_PACKETS("texturepacketsstat"), + TRIANGLES_DRAWN("trianglesdrawnstat"), + CHAT_COUNT("chatcount", "Chat messages sent"), + IM_COUNT("imcount", "IMs sent"), + OBJECT_CREATE("objectcreate"), + OBJECT_REZ("objectrez", "Object rez count"), + LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"), + LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), + FAILED_DOWNLOADS("faileddownloads", "Number of times LLAssetStorage::getAssetData() has failed"), + LSL_SAVES("lslsaves", "Number of times user has saved a script"), + ANIMATION_UPLOADS("animationuploads", "Animations uploaded"), + FLY("fly", "Fly count"), + TELEPORT("teleport", "Teleport count"), + DELETE_OBJECT("deleteobject", "Objects deleted"), + SNAPSHOT("snapshot", "Snapshots taken"), + UPLOAD_SOUND("uploadsound", "Sounds uploaded"), + UPLOAD_TEXTURE("uploadtexture", "Textures uploaded"), + EDIT_TEXTURE("edittexture", "Changes to textures on objects"), + KILLED("killed", "Number of times killed"), + FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), + TEX_BAKES("texbakes"), + TEX_REBAKES("texrebakes"); LLTrace::Rate > KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), @@ -98,53 +98,54 @@ LLTrace::Rate > KBIT("kbitstat"), ACTUAL_IN_KBIT("actualinkbit"), ACTUAL_OUT_KBIT("actualoutkbit"); -LLTrace::Rate > AVATAR_EDIT_TIME("avataredittimr"), - TOOLBOX_TIME("toolboxtime"), - MOUSELOOK_TIME("mouselooktime"), - FPS_10_TIME("fps10time"), - FPS_8_TIME("fps8time"), - FPS_2_TIME("fps2time"), - SIM_20_FPS_TIME("sim20fpstime"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime"), - LOSS_5_PERCENT_TIME("loss5percenttime"); - -LLTrace::Measurement SIM_TIME_DILATION("simtimedilation"), - SIM_FPS("simfps"), - SIM_PHYSICS_FPS("simphysicsfps"), - SIM_AGENT_UPS("simagentups"), - SIM_SCRIPT_EPS("simscripteps"), - SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps"), - SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters"), - SIM_MAIN_AGENTS("simmainagents"), - SIM_CHILD_AGENTS("simchildagents"), - SIM_OBJECTS("simobjects"), - SIM_ACTIVE_OBJECTS("simactiveobjects"), - SIM_ACTIVE_SCRIPTS("simactivescripts"), - SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun"), - SIM_IN_PACKETS_PER_SEC("siminpps"), - SIM_OUT_PACKETS_PER_SEC("simoutpps"), - SIM_PENDING_DOWNLOADS("simpendingdownloads"), - SIM_PENDING_UPLOADS("simpendinguploads"), - SIM_PENING_LOCAL_UPLOADS("simpendinglocaluploads"), - SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks"), - SIM_PHYSICS_LOD_TASKS("physicslodtasks"), - NUM_IMAGES("numimagesstat"), - NUM_RAW_IMAGES("numrawimagesstat"), - NUM_OBJECTS("numobjectsstat"), - NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_NEW_OBJECTS("numnewobjectsstat"), - NUM_SIZE_CULLED("numsizeculledstat"), - NUM_VIS_CULLED("numvisculledstat"), - ENABLE_VBO("enablevbo"), - DELTA_BANDWIDTH("deltabandwidth"), - MAX_BANDWIDTH("maxbandwidth"), - LIGHTING_DETAIL("lightingdetail"), - VISIBLE_AVATARS("visibleavatars"), - SHADER_OBJECTS("shaderobjects"), - DRAW_DISTANCE("drawdistance"), - CHAT_BUBBLES("chatbubbles"), - WINDOW_WIDTH("windowwidth"), - WINDOW_HEIGHT("windowheight"); +LLTrace::Rate > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"), + SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); + +LLTrace::Measurement SIM_TIME_DILATION("simtimedilation"), + SIM_FPS("simfps"), + SIM_PHYSICS_FPS("simphysicsfps"), + SIM_AGENT_UPS("simagentups"), + SIM_SCRIPT_EPS("simscripteps"), + SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps"), + SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters"), + SIM_MAIN_AGENTS("simmainagents"), + SIM_CHILD_AGENTS("simchildagents"), + SIM_OBJECTS("simobjects"), + SIM_ACTIVE_OBJECTS("simactiveobjects"), + SIM_ACTIVE_SCRIPTS("simactivescripts"), + SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun"), + SIM_IN_PACKETS_PER_SEC("siminpps"), + SIM_OUT_PACKETS_PER_SEC("simoutpps"), + SIM_PENDING_DOWNLOADS("simpendingdownloads"), + SIM_PENDING_UPLOADS("simpendinguploads"), + SIM_PENDING_LOCAL_UPLOADS("simpendinglocaluploads"), + SIM_PENDING_VFS_OPERATIONS("vfspendingoperations"), + SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks"), + SIM_PHYSICS_LOD_TASKS("physicslodtasks"), + NUM_IMAGES("numimagesstat"), + NUM_RAW_IMAGES("numrawimagesstat"), + NUM_OBJECTS("numobjectsstat"), + NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), + NUM_NEW_OBJECTS("numnewobjectsstat"), + NUM_SIZE_CULLED("numsizeculledstat"), + NUM_VIS_CULLED("numvisculledstat"), + ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), + DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"), + LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), + VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), + SHADER_OBJECTS("shaderobjects", "Object Shaders"), + DRAW_DISTANCE("drawdistance", "Draw Distance"), + CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"), + WINDOW_WIDTH("windowwidth", "Window width"), + WINDOW_HEIGHT("windowheight", "Window height"); LLTrace::Measurement > SIM_UNACKED_BYTES("simtotalunackedbytes"), SIM_PHYSICS_MEM("physicsmemoryallocated"), @@ -166,14 +167,16 @@ LLTrace::Measurement > SIM_PHYSICS_TIME("simsimphysicsmsec SIM_SLEEP_TIME("simsleepmsec"), SIM_PUMP_IO_TIME("simpumpiomsec"), SIM_PING("simpingstat"), - LOGIN_SECONDS("loginseconds"), - REGION_CROSSING_TIME("regioncrossingtime"), - FRAME_STACKTIME("framestacktime"), - UPDATE_STACKTIME("updatestacktime"), - NETWORK_STACKTIME("networkstacktime"), - IMAGE_STACKTIME("imagestacktime"), - REBUILD_STACKTIME("rebuildstacktime"), - RENDER_STACKTIME("renderstacktime"); + FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), + REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); } class StatAttributes @@ -190,139 +193,18 @@ public: BOOL mEnabled; }; -const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] = -{ - // ST_VERSION - StatAttributes("Version", TRUE), - // ST_AVATAR_EDIT_SECONDS - StatAttributes("Seconds in Edit Appearence", FALSE), - // ST_TOOLBOX_SECONDS - StatAttributes("Seconds using Toolbox", FALSE), - // ST_CHAT_COUNT - StatAttributes("Chat messages sent", FALSE), - // ST_IM_COUNT - StatAttributes("IMs sent", FALSE), - // ST_FULLSCREEN_BOOL - StatAttributes("Fullscreen mode", FALSE), - // ST_RELEASE_COUNT - StatAttributes("Object release count", FALSE), - // ST_CREATE_COUNT - StatAttributes("Object create count", FALSE), - // ST_REZ_COUNT - StatAttributes("Object rez count", FALSE), - // ST_FPS_10_SECONDS - StatAttributes("Seconds below 10 FPS", FALSE), - // ST_FPS_2_SECONDS - StatAttributes("Seconds below 2 FPS", FALSE), - // ST_MOUSELOOK_SECONDS - StatAttributes("Seconds in Mouselook", FALSE), - // ST_FLY_COUNT - StatAttributes("Fly count", FALSE), - // ST_TELEPORT_COUNT - StatAttributes("Teleport count", FALSE), - // ST_OBJECT_DELETE_COUNT - StatAttributes("Objects deleted", FALSE), - // ST_SNAPSHOT_COUNT - StatAttributes("Snapshots taken", FALSE), - // ST_UPLOAD_SOUND_COUNT - StatAttributes("Sounds uploaded", FALSE), - // ST_UPLOAD_TEXTURE_COUNT - StatAttributes("Textures uploaded", FALSE), - // ST_EDIT_TEXTURE_COUNT - StatAttributes("Changes to textures on objects", FALSE), - // ST_KILLED_COUNT - StatAttributes("Number of times killed", FALSE), - // ST_FRAMETIME_JITTER - StatAttributes("Average delta between successive frame times", FALSE), - // ST_FRAMETIME_SLEW - StatAttributes("Average delta between frame time and mean", FALSE), - // ST_INVENTORY_TOO_LONG - StatAttributes("Inventory took too long to load", FALSE), - // ST_WEARABLES_TOO_LONG - StatAttributes("Wearables took too long to load", FALSE), - // ST_LOGIN_SECONDS - StatAttributes("Time between LoginRequest and LoginReply", FALSE), - // ST_LOGIN_TIMEOUT_COUNT - StatAttributes("Number of login attempts that timed out", FALSE), - // ST_HAS_BAD_TIMER - StatAttributes("Known bad timer if != 0.0", FALSE), - // ST_DOWNLOAD_FAILED - StatAttributes("Number of times LLAssetStorage::getAssetData() has failed", FALSE), - // ST_LSL_SAVE_COUNT - StatAttributes("Number of times user has saved a script", FALSE), - // ST_UPLOAD_ANIM_COUNT - StatAttributes("Animations uploaded", FALSE), - // ST_FPS_8_SECONDS - StatAttributes("Seconds below 8 FPS", FALSE), - // ST_SIM_FPS_20_SECONDS - StatAttributes("Seconds with sim FPS below 20", FALSE), - // ST_PHYS_FPS_20_SECONDS - StatAttributes("Seconds with physics FPS below 20", FALSE), - // ST_LOSS_05_SECONDS - StatAttributes("Seconds with packet loss > 5%", FALSE), - // ST_FPS_DROP_50_RATIO - StatAttributes("Ratio of frames 2x longer than previous", FALSE), - // ST_ENABLE_VBO - StatAttributes("Vertex Buffers Enabled", TRUE), - // ST_DELTA_BANDWIDTH - StatAttributes("Increase/Decrease in bandwidth based on packet loss", FALSE), - // ST_MAX_BANDWIDTH - StatAttributes("Max bandwidth setting", FALSE), - // ST_LIGHTING_DETAIL - StatAttributes("Lighting Detail", FALSE), - // ST_VISIBLE_AVATARS - StatAttributes("Visible Avatars", FALSE), - // ST_SHADER_OJECTS - StatAttributes("Object Shaders", FALSE), - // ST_SHADER_ENVIRONMENT - StatAttributes("Environment Shaders", FALSE), - // ST_VISIBLE_DRAW_DIST - StatAttributes("Draw Distance", FALSE), - // ST_VISIBLE_CHAT_BUBBLES - StatAttributes("Chat Bubbles Enabled", FALSE), - // ST_SHADER_AVATAR - StatAttributes("Avatar Shaders", FALSE), - // ST_FRAME_SECS - StatAttributes("FRAME_SECS", FALSE), - // ST_UPDATE_SECS - StatAttributes("UPDATE_SECS", FALSE), - // ST_NETWORK_SECS - StatAttributes("NETWORK_SECS", FALSE), - // ST_IMAGE_SECS - StatAttributes("IMAGE_SECS", FALSE), - // ST_REBUILD_SECS - StatAttributes("REBUILD_SECS", FALSE), - // ST_RENDER_SECS - StatAttributes("RENDER_SECS", FALSE), - // ST_CROSSING_AVG - StatAttributes("CROSSING_AVG", FALSE), - // ST_CROSSING_MAX - StatAttributes("CROSSING_MAX", FALSE), - // ST_LIBXUL_WIDGET_USED - StatAttributes("LibXUL Widget used", FALSE), // Unused - // ST_WINDOW_WIDTH - StatAttributes("Window width", FALSE), - // ST_WINDOW_HEIGHT - StatAttributes("Window height", FALSE), - // ST_TEX_BAKES - StatAttributes("Texture Bakes", FALSE), - // ST_TEX_REBAKES - StatAttributes("Texture Rebakes", FALSE) - -}; - LLViewerStats::LLViewerStats() : - mVFSPendingOperations("vfspendingoperations"), - mFPSStat("fpsstat"), - mPacketsInStat("packetsinstat"), - mPacketsLostStat("packetsloststat"), - mPacketsOutStat("packetsoutstat"), - mPacketsLostPercentStat("packetslostpercentstat"), - mTexturePacketsStat("texturepacketsstat"), - mActualInKBitStat("actualinkbitstat"), - mActualOutKBitStat("actualoutkbitstat"), - mTrianglesDrawnStat("trianglesdrawnstat"), - mSimTimeDilation("simtimedilation"), + //mVFSPendingOperations("vfspendingoperations"), + //mFPSStat("fpsstat"), + //mPacketsInStat("packetsinstat"), + //mPacketsLostStat("packetsloststat"), + //mPacketsOutStat("packetsoutstat"), + //mPacketsLostPercentStat("packetslostpercentstat"), + //mTexturePacketsStat("texturepacketsstat"), + //mActualInKBitStat("actualinkbitstat"), + //mActualOutKBitStat("actualoutkbitstat"), + //mTrianglesDrawnStat("trianglesdrawnstat"), + //mSimTimeDilation("simtimedilation"), mSimFPS("simfps"), mSimPhysicsFPS("simphysicsfps"), mSimAgentUPS("simagentups"), @@ -393,13 +275,14 @@ LLViewerStats::~LLViewerStats() void LLViewerStats::resetStats() { LLViewerStats& stats = LLViewerStats::instance(); - stats.mVFSPendingOperations.reset(); - stats.mPacketsInStat.reset(); - stats.mPacketsLostStat.reset(); - stats.mPacketsOutStat.reset(); - stats.mFPSStat.reset(); - stats.mTexturePacketsStat.reset(); - stats.mAgentPositionSnaps.reset(); + stats.mRecording.reset(); + //stats.mVFSPendingOperations.reset(); + //stats.mPacketsInStat.reset(); + //stats.mPacketsLostStat.reset(); + //stats.mPacketsOutStat.reset(); + //stats.mFPSStat.reset(); + //stats.mTexturePacketsStat.reset(); + //stats.mAgentPositionSnaps.reset(); } @@ -484,16 +367,9 @@ void LLViewerStats::addToMessage(LLSD &body) const { LLSD &misc = body["misc"]; - for (S32 i = 0; i < ST_COUNT; i++) - { - if (STAT_INFO[i].mEnabled) - { - // TODO: send timer value so dataserver can normalize - misc[STAT_INFO[i].mName] = mStats[i]; - llinfos << "STAT: " << STAT_INFO[i].mName << ": " << mStats[i] - << llendl; - } - } + misc["Version"] = TRUE; + //TODO RN: get last value, not mean + misc["Vertex Buffers Enabled"] = mRecording.getMean(LLStatViewer::ENABLE_VBO); body["AgentPositionSnaps"] = mAgentPositionSnaps.asLLSD(); llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev() @@ -570,13 +446,15 @@ void update_statistics() stats.mSimPingStat.addValue(10000); } - stats.mFPSStat.addValue(1); + //stats.mFPSStat.addValue(1); + LLStatViewer::FPS.add(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); LLStatViewer::LAYERS_KBIT.add >(layer_bits); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); LLStatViewer::OBJECT_KBIT.add >(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); - stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); + //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); + LLStatViewer::SIM_PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); LLStatViewer::ASSET_KBIT.add >(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -615,12 +493,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - LLStatViewer::TEXTURE_KBIT.add >(LLViewerTextureList::sTextureBits); - //stats.mTextureKBitStat.addValue(LLViewerTextureList::sTextureBits/1024.f); - stats.mTexturePacketsStat.addValue(LLViewerTextureList::sTexturePackets); - gTotalTextureBytes += LLViewerTextureList::sTextureBits / 8; - LLViewerTextureList::sTextureBits = 0; - LLViewerTextureList::sTexturePackets = 0; + gTotalTextureBytes = LLUnits::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).get();//LLViewerTextureList::sTextureBits / 8; texture_stats_timer.reset(); } } -- cgit v1.2.3 From 0f58ca02cdec62711eadb82ba28fcff08faef2ee Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Oct 2012 00:20:19 -0700 Subject: SH-3275 WIP Update viewer metrics system to be more flexible cleaned up accumulator merging logic introduced frame recording to LLTrace directly instead of going through LLViewerStats moved consumer code over to frame recording instead of whatever the current active recording was --- indra/newview/llviewerstats.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 11d9f5e1ec..bed2dffb14 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -497,6 +497,8 @@ void update_statistics() texture_stats_timer.reset(); } } + + LLTrace::get_frame_recording().nextPeriod(); } class ViewerStatsResponder : public LLHTTPClient::Responder -- cgit v1.2.3 From 041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 12 Oct 2012 20:17:52 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system default to double precision now fixed unit conversion logic for LLUnit renamed LLTrace::Rate to LLTrace::Count and got rid of the old count as it was confusing some const correctness changes --- indra/newview/llviewerstats.cpp | 98 +++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 47 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index bed2dffb14..a3d04d655a 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -64,7 +64,7 @@ namespace LLStatViewer { -LLTrace::Rate FPS("fpsstat"), +LLTrace::Count<> FPS("fpsstat"), PACKETS_IN("packetsinstat"), PACKETS_LOST("packetsloststat"), PACKETS_OUT("packetsoutstat"), @@ -90,7 +90,7 @@ LLTrace::Rate FPS("fpsstat"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"); -LLTrace::Rate > KBIT("kbitstat"), +LLTrace::Count KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), @@ -98,17 +98,17 @@ LLTrace::Rate > KBIT("kbitstat"), ACTUAL_IN_KBIT("actualinkbit"), ACTUAL_OUT_KBIT("actualoutkbit"); -LLTrace::Rate > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), - TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), - MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), - FPS_10_TIME("fps10time", "Seconds below 10 FPS"), - FPS_8_TIME("fps8time", "Seconds below 8 FPS"), - FPS_2_TIME("fps2time", "Seconds below 2 FPS"), - SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), - LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); - -LLTrace::Measurement SIM_TIME_DILATION("simtimedilation"), +LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"), + SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); + +LLTrace::Measurement<> SIM_TIME_DILATION("simtimedilation"), SIM_FPS("simfps"), SIM_PHYSICS_FPS("simphysicsfps"), SIM_AGENT_UPS("simagentups"), @@ -147,36 +147,36 @@ LLTrace::Measurement SIM_TIME_DILATION("simtimedilation"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::Measurement > SIM_UNACKED_BYTES("simtotalunackedbytes"), - SIM_PHYSICS_MEM("physicsmemoryallocated"), - GL_TEX_MEM("gltexmemstat"), - GL_BOUND_MEM("glboundmemstat"), - RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"); - - -LLTrace::Measurement > SIM_PHYSICS_TIME("simsimphysicsmsec"), - SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec"), - SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec"), - SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec"), - SIM_AI_TIME("simsimaistepmsec"), - SIM_AGENTS_TIME("simagentmsec"), - SIM_IMAGES_TIME("simimagesmsec"), - SIM_SCRIPTS_TIME("simscriptmsec"), - SIM_SPARE_TIME("simsparemsec"), - SIM_SLEEP_TIME("simsleepmsec"), - SIM_PUMP_IO_TIME("simpumpiomsec"), - SIM_PING("simpingstat"), - FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), - REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), - FRAME_STACKTIME("framestacktime", "FRAME_SECS"), - UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), - NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), - IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), - REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), - RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); +LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), + SIM_PHYSICS_MEM("physicsmemoryallocated"), + GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"); + + +LLTrace::Measurement SIM_PHYSICS_TIME("simsimphysicsmsec"), + SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec"), + SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec"), + SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec"), + SIM_AI_TIME("simsimaistepmsec"), + SIM_AGENTS_TIME("simagentmsec"), + SIM_IMAGES_TIME("simimagesmsec"), + SIM_SCRIPTS_TIME("simscriptmsec"), + SIM_SPARE_TIME("simsparemsec"), + SIM_SLEEP_TIME("simsleepmsec"), + SIM_PUMP_IO_TIME("simpumpiomsec"), + SIM_PING("simpingstat"), + FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), + REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); } class StatAttributes @@ -266,6 +266,7 @@ LLViewerStats::LLViewerStats() : mAgentPositionSnaps.reset(); mRecording.start(); + LLTrace::get_frame_recording().start(); } LLViewerStats::~LLViewerStats() @@ -437,25 +438,28 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { + LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { + LLUnits::Seconds i(10000); + LLStatViewer::SIM_PING.sample(i);// >(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 >(layer_bits); + LLStatViewer::LAYERS_KBIT.add(layer_bits); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - LLStatViewer::OBJECT_KBIT.add >(gObjectBits); + LLStatViewer::OBJECT_KBIT.add(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); LLStatViewer::SIM_PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); - LLStatViewer::ASSET_KBIT.add >(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); + LLStatViewer::ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -493,7 +497,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureBytes = LLUnits::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureBytes = LLUnits::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); texture_stats_timer.reset(); } } -- cgit v1.2.3 From 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Oct 2012 19:43:35 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted all remaining LLViewerStats to lltrace --- indra/newview/llviewerstats.cpp | 344 ++++++++++++++++------------------------ 1 file changed, 133 insertions(+), 211 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index a3d04d655a..f0ad04e0ba 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -76,7 +76,6 @@ LLTrace::Count<> FPS("fpsstat"), OBJECT_REZ("objectrez", "Object rez count"), LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"), LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), - FAILED_DOWNLOADS("faileddownloads", "Number of times LLAssetStorage::getAssetData() has failed"), LSL_SAVES("lslsaves", "Number of times user has saved a script"), ANIMATION_UPLOADS("animationuploads", "Animations uploaded"), FLY("fly", "Fly count"), @@ -108,28 +107,28 @@ LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); -LLTrace::Measurement<> SIM_TIME_DILATION("simtimedilation"), - SIM_FPS("simfps"), - SIM_PHYSICS_FPS("simphysicsfps"), - SIM_AGENT_UPS("simagentups"), - SIM_SCRIPT_EPS("simscripteps"), - SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps"), - SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters"), - SIM_MAIN_AGENTS("simmainagents"), - SIM_CHILD_AGENTS("simchildagents"), - SIM_OBJECTS("simobjects"), - SIM_ACTIVE_OBJECTS("simactiveobjects"), - SIM_ACTIVE_SCRIPTS("simactivescripts"), - SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun"), - SIM_IN_PACKETS_PER_SEC("siminpps"), - SIM_OUT_PACKETS_PER_SEC("simoutpps"), - SIM_PENDING_DOWNLOADS("simpendingdownloads"), - SIM_PENDING_UPLOADS("simpendinguploads"), - SIM_PENDING_LOCAL_UPLOADS("simpendinglocaluploads"), - SIM_PENDING_VFS_OPERATIONS("vfspendingoperations"), - SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks"), - SIM_PHYSICS_LOD_TASKS("physicslodtasks"), - NUM_IMAGES("numimagesstat"), +SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DILATION), + SIM_FPS("simfps", "", LL_SIM_STAT_FPS), + SIM_PHYSICS_FPS("simphysicsfps", "", LL_SIM_STAT_PHYSFPS), + SIM_AGENT_UPS("simagentups", "", LL_SIM_STAT_AGENTUPS), + SIM_SCRIPT_EPS("simscripteps", "", LL_SIM_STAT_SCRIPT_EPS), + SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps", "", LL_SIM_STAT_SKIPPEDAISILSTEPS_PS), + SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS), + SIM_MAIN_AGENTS("simmainagents", "", LL_SIM_STAT_NUMAGENTMAIN), + SIM_CHILD_AGENTS("simchildagents", "", LL_SIM_STAT_NUMAGENTCHILD), + SIM_OBJECTS("simobjects", "", LL_SIM_STAT_NUMTASKS), + SIM_ACTIVE_OBJECTS("simactiveobjects", "", LL_SIM_STAT_NUMTASKSACTIVE), + SIM_ACTIVE_SCRIPTS("simactivescripts", "", LL_SIM_STAT_NUMSCRIPTSACTIVE), + SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN), + SIM_IN_PACKETS_PER_SEC("siminpps", "", LL_SIM_STAT_INPPS), + SIM_OUT_PACKETS_PER_SEC("simoutpps", "", LL_SIM_STAT_OUTPPS), + SIM_PENDING_DOWNLOADS("simpendingdownloads", "", LL_SIM_STAT_PENDING_DOWNLOADS), + SIM_PENDING_UPLOADS("simpendinguploads", "", LL_SIM_STAT_PENDING_UPLOADS), + SIM_PENDING_LOCAL_UPLOADS("simpendinglocaluploads", "", LL_SIM_STAT_PENDING_LOCAL_UPLOADS), + SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), + SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); + +LLTrace::Measurement<> NUM_IMAGES("numimagesstat"), NUM_RAW_IMAGES("numrawimagesstat"), NUM_OBJECTS("numobjectsstat"), NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), @@ -137,134 +136,61 @@ LLTrace::Measurement<> SIM_TIME_DILATION("simtimedilation"), NUM_SIZE_CULLED("numsizeculledstat"), NUM_VIS_CULLED("numvisculledstat"), ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), - DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), - MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"), LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), SHADER_OBJECTS("shaderobjects", "Object Shaders"), DRAW_DISTANCE("drawdistance", "Draw Distance"), CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"), + PENDING_VFS_OPERATIONS("vfspendingoperations"), + PACKETS_LOST_PERCENT("packetslostpercentstat"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); +LLTrace::Measurement AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); + + LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), SIM_PHYSICS_MEM("physicsmemoryallocated"), GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"); - - -LLTrace::Measurement SIM_PHYSICS_TIME("simsimphysicsmsec"), - SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec"), - SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec"), - SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec"), - SIM_AI_TIME("simsimaistepmsec"), - SIM_AGENTS_TIME("simagentmsec"), - SIM_IMAGES_TIME("simimagesmsec"), - SIM_SCRIPTS_TIME("simscriptmsec"), - SIM_SPARE_TIME("simsparemsec"), - SIM_SLEEP_TIME("simsleepmsec"), - SIM_PUMP_IO_TIME("simpumpiomsec"), - SIM_PING("simpingstat"), - FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), - REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), - FRAME_STACKTIME("framestacktime", "FRAME_SECS"), - UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), - NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), - IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), - REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), - RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -} + FORMATTED_MEM("formattedmemstat"), + DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); + + +SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), + SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), + SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), + SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), + SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec", "", LL_SIM_STAT_SIMPHYSICSSTEPMS), + SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec", "", LL_SIM_STAT_SIMPHYSICSSHAPEMS), + SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec", "", LL_SIM_STAT_SIMPHYSICSOTHERMS), + SIM_AI_TIME("simsimaistepmsec", "", LL_SIM_STAT_SIMAISTEPTIMEMS), + SIM_AGENTS_TIME("simagentmsec", "", LL_SIM_STAT_AGENTMS), + SIM_IMAGES_TIME("simimagesmsec", "", LL_SIM_STAT_IMAGESMS), + SIM_SCRIPTS_TIME("simscriptmsec", "", LL_SIM_STAT_SCRIPTMS), + SIM_SPARE_TIME("simsparemsec", "", LL_SIM_STAT_SIMSPARETIME), + SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), + SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); + +LLTrace::Measurement FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), + REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"), + SIM_PING("simpingstat"); -class StatAttributes -{ -public: - StatAttributes(const char* name, - const BOOL enabled) - : mName(name), - mEnabled(enabled) - { - } - - std::string mName; - BOOL mEnabled; -}; +} -LLViewerStats::LLViewerStats() : - //mVFSPendingOperations("vfspendingoperations"), - //mFPSStat("fpsstat"), - //mPacketsInStat("packetsinstat"), - //mPacketsLostStat("packetsloststat"), - //mPacketsOutStat("packetsoutstat"), - //mPacketsLostPercentStat("packetslostpercentstat"), - //mTexturePacketsStat("texturepacketsstat"), - //mActualInKBitStat("actualinkbitstat"), - //mActualOutKBitStat("actualoutkbitstat"), - //mTrianglesDrawnStat("trianglesdrawnstat"), - //mSimTimeDilation("simtimedilation"), - mSimFPS("simfps"), - mSimPhysicsFPS("simphysicsfps"), - mSimAgentUPS("simagentups"), - mSimScriptEPS("simscripteps"), - mSimFrameMsec("simframemsec"), - mSimNetMsec("simnetmsec"), - mSimSimOtherMsec("simsimothermsec"), - mSimSimPhysicsMsec("simsimphysicsmsec"), - mSimSimPhysicsStepMsec("simsimphysicsstepmsec"), - mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"), - mSimSimPhysicsOtherMsec("simsimphysicsothermsec"), - mSimSimAIStepMsec("simsimaistepmsec"), - mSimSimSkippedSilhouetteSteps("simsimskippedsilhouettesteps"), - mSimSimPctSteppedCharacters("simsimpctsteppedcharacters"), - mSimAgentMsec("simagentmsec"), - mSimImagesMsec("simimagesmsec"), - mSimScriptMsec("simscriptmsec"), - mSimSpareMsec("simsparemsec"), - mSimSleepMsec("simsleepmsec"), - mSimPumpIOMsec("simpumpiomsec"), - mSimMainAgents("simmainagents"), - mSimChildAgents("simchildagents"), - mSimObjects("simobjects"), - mSimActiveObjects("simactiveobjects"), - mSimActiveScripts("simactivescripts"), - mSimPctScriptsRun("simpctscriptsrun"), - mSimInPPS("siminpps"), - mSimOutPPS("simoutpps"), - mSimPendingDownloads("simpendingdownloads"), - mSimPendingUploads("simpendinguploads"), - mSimPendingLocalUploads("simpendinglocaluploads"), - mSimTotalUnackedBytes("simtotalunackedbytes"), - mPhysicsPinnedTasks("physicspinnedtasks"), - mPhysicsLODTasks("physicslodtasks"), - mPhysicsMemoryAllocated("physicsmemoryallocated"), - mSimPingStat("simpingstat"), - mNumImagesStat("numimagesstat", TRUE), - mNumRawImagesStat("numrawimagesstat", TRUE), - mGLTexMemStat("gltexmemstat", TRUE), - mGLBoundMemStat("glboundmemstat", TRUE), - mRawMemStat("rawmemstat", TRUE), - mFormattedMemStat("formattedmemstat", TRUE), - mNumObjectsStat("numobjectsstat"), - mNumActiveObjectsStat("numactiveobjectsstat"), - mNumNewObjectsStat("numnewobjectsstat"), - mNumSizeCulledStat("numsizeculledstat"), - mNumVisCulledStat("numvisculledstat"), - mLastTimeDiff(0.0) +LLViewerStats::LLViewerStats() +: mLastTimeDiff(0.0) { - for (S32 i = 0; i < ST_COUNT; i++) - { - mStats[i] = 0.0; - } - - if (LLTimer::knownBadTimer()) - { - mStats[ST_HAS_BAD_TIMER] = 1.0; - } - - mAgentPositionSnaps.reset(); mRecording.start(); LLTrace::get_frame_recording().start(); } @@ -275,93 +201,80 @@ LLViewerStats::~LLViewerStats() void LLViewerStats::resetStats() { - LLViewerStats& stats = LLViewerStats::instance(); - stats.mRecording.reset(); - //stats.mVFSPendingOperations.reset(); - //stats.mPacketsInStat.reset(); - //stats.mPacketsLostStat.reset(); - //stats.mPacketsOutStat.reset(); - //stats.mFPSStat.reset(); - //stats.mTexturePacketsStat.reset(); - //stats.mAgentPositionSnaps.reset(); -} - - -F64 LLViewerStats::getStat(EStatType type) const -{ - return mStats[type]; -} - -F64 LLViewerStats::setStat(EStatType type, F64 value) -{ - mStats[type] = value; - return mStats[type]; -} - -F64 LLViewerStats::incStat(EStatType type, F64 value) -{ - mStats[type] += value; - return mStats[type]; + LLViewerStats::instance().mRecording.reset(); } void LLViewerStats::updateFrameStats(const F64 time_diff) { - if (mPacketsLostPercentStat.getCurrent() > 5.0) + if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { - incStat(ST_LOSS_05_SECONDS, time_diff); + LLStatViewer::LOSS_5_PERCENT_TIME.add(time_diff); + //incStat(ST_LOSS_05_SECONDS, time_diff); } - if (mSimFPS.getCurrent() < 20.f && mSimFPS.getCurrent() > 0.f) + F32 sim_fps = getRecording().getLastValue(LLStatViewer::SIM_FPS); + if (0.f < sim_fps && sim_fps < 20.f) { - incStat(ST_SIM_FPS_20_SECONDS, time_diff); + LLStatViewer::SIM_20_FPS_TIME.add(time_diff); + //incStat(ST_SIM_FPS_20_SECONDS, time_diff); } - if (mSimPhysicsFPS.getCurrent() < 20.f && mSimPhysicsFPS.getCurrent() > 0.f) + F32 sim_physics_fps = getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS); + + if (0.f < sim_physics_fps && sim_physics_fps < 20.f) { - incStat(ST_PHYS_FPS_20_SECONDS, time_diff); + LLStatViewer::SIM_PHYSICS_20_FPS_TIME.add(time_diff); + //incStat(ST_PHYS_FPS_20_SECONDS, time_diff); } if (time_diff >= 0.5) { - incStat(ST_FPS_2_SECONDS, time_diff); + LLStatViewer::FPS_2_TIME.add(time_diff); + //incStat(ST_FPS_2_SECONDS, time_diff); } if (time_diff >= 0.125) { - incStat(ST_FPS_8_SECONDS, time_diff); + LLStatViewer::FPS_8_TIME.add(time_diff); + //incStat(ST_FPS_8_SECONDS, time_diff); } if (time_diff >= 0.1) { - incStat(ST_FPS_10_SECONDS, time_diff); + LLStatViewer::FPS_10_TIME.add(time_diff); + //incStat(ST_FPS_10_SECONDS, time_diff); } if (gFrameCount && mLastTimeDiff > 0.0) { // new "stutter" meter - 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); + 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 - setStat(ST_FRAMETIME_JITTER, - (getStat(ST_FRAMETIME_JITTER) * (gFrameCount - 1) + - fabs(mLastTimeDiff - time_diff) / mLastTimeDiff) / gFrameCount); + LLStatViewer::FRAMETIME_JITTER.sample(mLastTimeDiff - time_diff); + //setStat(ST_FRAMETIME_JITTER, + // (getStat(ST_FRAMETIME_JITTER) * (gFrameCount - 1) + + // fabs(mLastTimeDiff - time_diff) / mLastTimeDiff) / gFrameCount); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - setStat(ST_FRAMETIME_SLEW, - (getStat(ST_FRAMETIME_SLEW) * (gFrameCount - 1) + - fabs(average_frametime - time_diff) / average_frametime) / 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); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); + LLStatViewer::DELTA_BANDWIDTH.sample(delta_bandwidth); + //setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); - setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f); + LLStatViewer::MAX_BANDWIDTH.sample(max_bandwidth); + //setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f); } mLastTimeDiff = time_diff; - } void LLViewerStats::addToMessage(LLSD &body) const @@ -370,11 +283,11 @@ void LLViewerStats::addToMessage(LLSD &body) const misc["Version"] = TRUE; //TODO RN: get last value, not mean - misc["Vertex Buffers Enabled"] = mRecording.getMean(LLStatViewer::ENABLE_VBO); + misc["Vertex Buffers Enabled"] = getRecording().getMean(LLStatViewer::ENABLE_VBO); - body["AgentPositionSnaps"] = mAgentPositionSnaps.asLLSD(); - llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev() - << "; Count = " << mAgentPositionSnaps.getCount() << llendl; + body["AgentPositionSnaps"] = getRecording().getSum(LLStatViewer::AGENT_POSITION_SNAP).value(); //mAgentPositionSnaps.asLLSD(); + llinfos << "STAT: AgentPositionSnaps: Mean = " << getRecording().getMean(LLStatViewer::AGENT_POSITION_SNAP).value() << "; StdDev = " << getRecording().getStandardDeviation(LLStatViewer::AGENT_POSITION_SNAP).value() + << "; Count = " << getRecording().getSampleCount(LLStatViewer::AGENT_POSITION_SNAP) << llendl; } // *NOTE:Mani The following methods used to exist in viewer.cpp @@ -386,8 +299,6 @@ 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; F32 gAvgSimPing = 0.f; @@ -403,51 +314,61 @@ void update_statistics() gTotalWorldBytes += gVLManager.getTotalBytes(); gTotalObjectBytes += gObjectBits / 8; - LLViewerStats& stats = LLViewerStats::instance(); - // make sure we have a valid time delta for this frame if (gFrameIntervalSeconds > 0.f) { if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); + LLStatViewer::MOUSELOOK_TIME.add(gFrameIntervalSeconds); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); } else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); + LLStatViewer::AVATAR_EDIT_TIME.add(gFrameIntervalSeconds); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); } else if (LLFloaterReg::instanceVisible("build")) { - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); + LLStatViewer::TOOLBOX_TIME.add(gFrameIntervalSeconds); + //LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); } } - stats.setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - stats.setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); - stats.setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); - stats.setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); - - stats.setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime("Frame")); + 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")); F64 idle_secs = gDebugView->mFastTimerView->getTime("Idle"); F64 network_secs = gDebugView->mFastTimerView->getTime("Network"); - stats.setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); - stats.setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); - stats.setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime("Update Images")); - stats.setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime("Sort Draw State")); - stats.setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime("Geometry")); + 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")); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); - stats.mSimPingStat.addValue(cdp->getPingDelay()); + //stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLUnits::Seconds i(10000); - LLStatViewer::SIM_PING.sample(i);// >(10000); - stats.mSimPingStat.addValue(10000); + LLStatViewer::SIM_PING.sample(10000); + //stats.mSimPingStat.addValue(10000); } //stats.mFPSStat.addValue(1); @@ -458,7 +379,7 @@ void update_statistics() LLStatViewer::OBJECT_KBIT.add(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); - LLStatViewer::SIM_PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); + LLStatViewer::PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); LLStatViewer::ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -481,7 +402,8 @@ void update_statistics() visible_avatar_frames = 1.f; avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; } - stats.setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); + LLStatViewer::VISIBLE_AVATARS.sample((F64)avg_visible_avatars); + //stats.setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); } LLWorld::getInstance()->updateNetStats(); LLWorld::getInstance()->requestCacheMisses(); -- cgit v1.2.3 From e6ca5471a2a816a24888ae1b38332531b22b7254 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 00:06:22 -0700 Subject: SH-3275 Update viewer metrics system to be more flexible put template parameter back in LLUnit units added free function operators for mathematical manipulation of unit values converted texture memory tracking to units --- indra/newview/llviewerstats.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f0ad04e0ba..ccc0c9ba59 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,7 +89,7 @@ LLTrace::Count<> FPS("fpsstat"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"); -LLTrace::Count KBIT("kbitstat"), +LLTrace::Count KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), @@ -97,7 +97,7 @@ LLTrace::Count KBIT("kbitstat"), ACTUAL_IN_KBIT("actualinkbit"), ACTUAL_OUT_KBIT("actualoutkbit"); -LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), +LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -146,10 +146,10 @@ LLTrace::Measurement<> NUM_IMAGES("numimagesstat"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::Measurement AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +LLTrace::Measurement AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); -LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), +LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), SIM_PHYSICS_MEM("physicsmemoryallocated"), GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), @@ -159,7 +159,7 @@ LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -174,7 +174,7 @@ SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -LLTrace::Measurement FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::Measurement FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), @@ -266,10 +266,10 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - LLStatViewer::DELTA_BANDWIDTH.sample(delta_bandwidth); + LLStatViewer::DELTA_BANDWIDTH.sample(delta_bandwidth); //setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); - LLStatViewer::MAX_BANDWIDTH.sample(max_bandwidth); + LLStatViewer::MAX_BANDWIDTH.sample(max_bandwidth); //setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f); } @@ -360,27 +360,27 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); + LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); //stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLStatViewer::SIM_PING.sample(10000); + LLStatViewer::SIM_PING.sample(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(layer_bits); + LLStatViewer::LAYERS_KBIT.add(layer_bits); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - LLStatViewer::OBJECT_KBIT.add(gObjectBits); + LLStatViewer::OBJECT_KBIT.add(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); LLStatViewer::PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); - LLStatViewer::ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); + LLStatViewer::ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -419,7 +419,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureBytes = LLUnits::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureBytes = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); texture_stats_timer.reset(); } } -- cgit v1.2.3 From a52d203a4f1d2988e8ffba16258f3f132f22f56d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 20:00:07 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system started conversion of llviewerassetstats removed old, dead LLViewerStats code made units tracing require units declaration clean up of units handling --- indra/newview/llviewerstats.cpp | 95 +++++++++++++---------------------------- 1 file changed, 29 insertions(+), 66 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') 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(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(average_frametime - time_diff); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; LLStatViewer::DELTA_BANDWIDTH.sample(delta_bandwidth); - //setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); - LLStatViewer::MAX_BANDWIDTH.sample(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 gTotalWorldData = 0, + gTotalObjectData = 0, + gTotalTextureData = 0; +U32 gSimPingCount = 0; +LLUnit::Bits gObjectData = 0; F32 gAvgSimPing = 0.f; -U32 gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnit::Bytes 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(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(idle_secs - network_secs); + LLStatViewer::NETWORK_STACKTIME.sample(network_secs); + LLStatViewer::IMAGE_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Update Images")); + LLStatViewer::REBUILD_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Sort Draw State")); + LLStatViewer::RENDER_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Geometry")); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); - //stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { LLStatViewer::SIM_PING.sample(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(layer_bits); - //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - LLStatViewer::OBJECT_KBIT.add(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(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"]; -- cgit v1.2.3 From 1fadd6138eebf980776f80b9642f4c19279fcadd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 18 Oct 2012 17:32:44 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed trace recording on background threads hitting null pointer --- indra/newview/llviewerstats.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 963d2ebb81..03cc9b12e3 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -149,9 +149,7 @@ LLTrace::Measurement<> NUM_IMAGES("numimagesstat"), LLTrace::Measurement AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); -LLTrace::Measurement SIM_UNACKED_BYTES("simtotalunackedbytes"), - SIM_PHYSICS_MEM("physicsmemoryallocated"), - GL_TEX_MEM("gltexmemstat"), +LLTrace::Measurement GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), FORMATTED_MEM("formattedmemstat"), @@ -174,6 +172,10 @@ SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); +SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), + SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); + + LLTrace::Measurement FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), -- cgit v1.2.3 From 176ffa54b44f2ef73f23e3252dd439f52fab3265 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 19 Oct 2012 19:35:01 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system finished most of conversion of llviewerassetstats ported some param block fixes from viewer-chui converted viewer asset stats to param block format --- indra/newview/llviewerstats.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 03cc9b12e3..04b0c30b40 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -128,7 +128,8 @@ SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DIL SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); -LLTrace::Measurement<> NUM_IMAGES("numimagesstat"), +LLTrace::Measurement<> FPS_SAMPLE("fpssample"), + NUM_IMAGES("numimagesstat"), NUM_RAW_IMAGES("numrawimagesstat"), NUM_OBJECTS("numobjectsstat"), NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), @@ -343,6 +344,7 @@ void update_statistics() } LLStatViewer::FPS.add(1); + LLStatViewer::FPS_SAMPLE.sample(LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); LLStatViewer::LAYERS_KBIT.add(layer_bits); LLStatViewer::OBJECT_KBIT.add(gObjectData); -- cgit v1.2.3 From 819adb5eb4d7f982121f3dbd82750e05d26864d9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 00:26:44 -0700 Subject: SH-3405 FIX convert existing stats to lltrace system final removal of remaining LLStat code --- indra/newview/llviewerstats.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 04b0c30b40..a42368cec4 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -94,8 +94,8 @@ LLTrace::Count KBIT("kbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbit"), - ACTUAL_OUT_KBIT("actualoutkbit"); + ACTUAL_IN_KBIT("actualinkbitstat"), + ACTUAL_OUT_KBIT("actualoutkbitstat"); LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), @@ -276,20 +276,25 @@ void LLViewerStats::addToMessage(LLSD &body) const // *NOTE:Mani The following methods used to exist in viewer.cpp // Moving them here, but not merging them into LLViewerStats yet. -U32 gTotalLandIn = 0, gTotalLandOut = 0; -U32 gTotalWaterIn = 0, gTotalWaterOut = 0; - -F32 gAveLandCompression = 0.f, gAveWaterCompression = 0.f; -F32 gBestLandCompression = 1.f, gBestWaterCompression = 1.f; -F32 gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; +U32 gTotalLandIn = 0, + gTotalLandOut = 0, + gTotalWaterIn = 0, + gTotalWaterOut = 0; + +F32 gAveLandCompression = 0.f, + gAveWaterCompression = 0.f, + gBestLandCompression = 1.f, + gBestWaterCompression = 1.f, + gWorstLandCompression = 0.f, + gWorstWaterCompression = 0.f; LLUnit::Bytes gTotalWorldData = 0, gTotalObjectData = 0, gTotalTextureData = 0; -U32 gSimPingCount = 0; +U32 gSimPingCount = 0; LLUnit::Bits gObjectData = 0; -F32 gAvgSimPing = 0.f; -LLUnit::Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +F32 gAvgSimPing = 0.f; +LLUnit::Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; @@ -334,13 +339,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); + LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLStatViewer::SIM_PING.sample(10000); + LLStatViewer::SIM_PING.sample(10); } LLStatViewer::FPS.add(1); @@ -390,8 +395,6 @@ void update_statistics() texture_stats_timer.reset(); } } - - LLTrace::get_frame_recording().nextPeriod(); } class ViewerStatsResponder : public LLHTTPClient::Responder -- cgit v1.2.3 From 860ff2f7e2a7fe932dfb7c148f0dbc0067018038 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 7 Nov 2012 00:38:21 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct fixed trace data gathering and routing from background thread simplified slave->master thread communication (eliminated redundant recording and proxy object) improved performance of fast timer data gathering (slow iterators) --- indra/newview/llviewerstats.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index a42368cec4..317fe5eaf8 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -349,7 +349,10 @@ void update_statistics() } LLStatViewer::FPS.add(1); - LLStatViewer::FPS_SAMPLE.sample(LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); + if (LLTrace::get_frame_recording().getTotalRecording().getSampleCount(LLStatViewer::FPS)) + { + LLStatViewer::FPS_SAMPLE.sample(LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); + } F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); LLStatViewer::LAYERS_KBIT.add(layer_bits); LLStatViewer::OBJECT_KBIT.add(gObjectData); -- cgit v1.2.3 From 0bb0bd514b235948c1a21c81ab0e8ab6223b1990 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 8 Nov 2012 23:42:18 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct Finished making LLUnit implicitly convertible to/from scalar integer values cleaned up test code --- indra/newview/llviewerstats.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 317fe5eaf8..36b1179e04 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -288,13 +288,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnit::Bytes gTotalWorldData = 0, +LLUnit gTotalWorldData = 0, gTotalObjectData = 0, gTotalTextureData = 0; U32 gSimPingCount = 0; -LLUnit::Bits gObjectData = 0; +LLUnit gObjectData = 0; F32 gAvgSimPing = 0.f; -LLUnit::Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnit gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; -- cgit v1.2.3 From 512d7381eca7bc53bb31e9528e5a7c5df189e82d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 11 Jan 2013 15:45:20 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system gcc 4.1 fixes --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 077c9f43a4..136a4d0a9e 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -394,7 +394,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); texture_stats_timer.reset(); } } -- cgit v1.2.3 From f07b9c2c69f1f6882dcf249aacf33cdfacf878ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Mar 2013 11:08:25 -0800 Subject: renamed LLTrace stat gathering classes/methods to make the structure of LLTrace clearer Count becomes CountStatHandle Count.sum becomes sum(Count, value), etc. --- indra/newview/llviewerstats.cpp | 222 ++++++++++++++++++++-------------------- 1 file changed, 111 insertions(+), 111 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 136a4d0a9e..921c681e2a 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -64,48 +64,48 @@ namespace LLStatViewer { -LLTrace::Count<> FPS("fpsstat"), - PACKETS_IN("packetsinstat"), - PACKETS_LOST("packetsloststat"), - PACKETS_OUT("packetsoutstat"), - TEXTURE_PACKETS("texturepacketsstat"), - TRIANGLES_DRAWN("trianglesdrawnstat"), - CHAT_COUNT("chatcount", "Chat messages sent"), - IM_COUNT("imcount", "IMs sent"), - OBJECT_CREATE("objectcreate"), - OBJECT_REZ("objectrez", "Object rez count"), - LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"), - LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), - LSL_SAVES("lslsaves", "Number of times user has saved a script"), - ANIMATION_UPLOADS("animationuploads", "Animations uploaded"), - FLY("fly", "Fly count"), - TELEPORT("teleport", "Teleport count"), - DELETE_OBJECT("deleteobject", "Objects deleted"), - SNAPSHOT("snapshot", "Snapshots taken"), - UPLOAD_SOUND("uploadsound", "Sounds uploaded"), - UPLOAD_TEXTURE("uploadtexture", "Textures uploaded"), - EDIT_TEXTURE("edittexture", "Changes to textures on objects"), - KILLED("killed", "Number of times killed"), - FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), - TEX_BAKES("texbakes"), - TEX_REBAKES("texrebakes"); -LLTrace::Count KBIT("kbitstat"), - LAYERS_KBIT("layerskbitstat"), - OBJECT_KBIT("objectkbitstat"), - ASSET_KBIT("assetkbitstat"), - TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbitstat"), - ACTUAL_OUT_KBIT("actualoutkbitstat"); - -LLTrace::Count AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), - TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), - MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), - FPS_10_TIME("fps10time", "Seconds below 10 FPS"), - FPS_8_TIME("fps8time", "Seconds below 8 FPS"), - FPS_2_TIME("fps2time", "Seconds below 2 FPS"), - SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), - LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); +LLTrace::CountStatHandle<> FPS("fpsstat"), + PACKETS_IN("packetsinstat"), + PACKETS_LOST("packetsloststat"), + PACKETS_OUT("packetsoutstat"), + TEXTURE_PACKETS("texturepacketsstat"), + TRIANGLES_DRAWN("trianglesdrawnstat"), + CHAT_COUNT("chatcount", "Chat messages sent"), + IM_COUNT("imcount", "IMs sent"), + OBJECT_CREATE("objectcreate"), + OBJECT_REZ("objectrez", "Object rez count"), + LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"), + LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), + LSL_SAVES("lslsaves", "Number of times user has saved a script"), + ANIMATION_UPLOADS("animationuploads", "Animations uploaded"), + FLY("fly", "Fly count"), + TELEPORT("teleport", "Teleport count"), + DELETE_OBJECT("deleteobject", "Objects deleted"), + SNAPSHOT("snapshot", "Snapshots taken"), + UPLOAD_SOUND("uploadsound", "Sounds uploaded"), + UPLOAD_TEXTURE("uploadtexture", "Textures uploaded"), + EDIT_TEXTURE("edittexture", "Changes to textures on objects"), + KILLED("killed", "Number of times killed"), + FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), + TEX_BAKES("texbakes"), + TEX_REBAKES("texrebakes"); +LLTrace::CountStatHandle KBIT("kbitstat"), + LAYERS_KBIT("layerskbitstat"), + OBJECT_KBIT("objectkbitstat"), + ASSET_KBIT("assetkbitstat"), + TEXTURE_KBIT("texturekbitstat"), + ACTUAL_IN_KBIT("actualinkbitstat"), + ACTUAL_OUT_KBIT("actualoutkbitstat"); + +LLTrace::CountStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"), + SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DILATION), SIM_FPS("simfps", "", LL_SIM_STAT_FPS), @@ -128,34 +128,34 @@ SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DIL SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); -LLTrace::Measurement<> FPS_SAMPLE("fpssample"), - NUM_IMAGES("numimagesstat"), - NUM_RAW_IMAGES("numrawimagesstat"), - NUM_OBJECTS("numobjectsstat"), - NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_NEW_OBJECTS("numnewobjectsstat"), - NUM_SIZE_CULLED("numsizeculledstat"), - NUM_VIS_CULLED("numvisculledstat"), - ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), - LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), - VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), - SHADER_OBJECTS("shaderobjects", "Object Shaders"), - DRAW_DISTANCE("drawdistance", "Draw Distance"), - CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"), - PENDING_VFS_OPERATIONS("vfspendingoperations"), - PACKETS_LOST_PERCENT("packetslostpercentstat"), - WINDOW_WIDTH("windowwidth", "Window width"), - WINDOW_HEIGHT("windowheight", "Window height"); +LLTrace::MeasurementStatHandle<> FPS_SAMPLE("fpssample"), + NUM_IMAGES("numimagesstat"), + NUM_RAW_IMAGES("numrawimagesstat"), + NUM_OBJECTS("numobjectsstat"), + NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), + NUM_NEW_OBJECTS("numnewobjectsstat"), + NUM_SIZE_CULLED("numsizeculledstat"), + NUM_VIS_CULLED("numvisculledstat"), + ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), + LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), + VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), + SHADER_OBJECTS("shaderobjects", "Object Shaders"), + DRAW_DISTANCE("drawdistance", "Draw Distance"), + CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"), + PENDING_VFS_OPERATIONS("vfspendingoperations"), + PACKETS_LOST_PERCENT("packetslostpercentstat"), + WINDOW_WIDTH("windowwidth", "Window width"), + WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::Measurement AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +LLTrace::MeasurementStatHandle AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); -LLTrace::Measurement GL_TEX_MEM("gltexmemstat"), - GL_BOUND_MEM("glboundmemstat"), - RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"), - DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), - MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); +LLTrace::MeasurementStatHandle GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"), + DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), @@ -177,17 +177,17 @@ SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_ SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::Measurement FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), - REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), - FRAME_STACKTIME("framestacktime", "FRAME_SECS"), - UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), - NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), - IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), - REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), - RENDER_STACKTIME("renderstacktime", "RENDER_SECS"), - SIM_PING("simpingstat"); +LLTrace::MeasurementStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), + REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"), + SIM_PING("simpingstat"); } @@ -212,50 +212,50 @@ 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_seconds); + add(LLStatViewer::LOSS_5_PERCENT_TIME, 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_seconds); + add(LLStatViewer::SIM_20_FPS_TIME, 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_seconds); + add(LLStatViewer::SIM_PHYSICS_20_FPS_TIME, time_diff_seconds); } if (time_diff >= 0.5) { - LLStatViewer::FPS_2_TIME.add(time_diff_seconds); + add(LLStatViewer::FPS_2_TIME, time_diff_seconds); } if (time_diff >= 0.125) { - LLStatViewer::FPS_8_TIME.add(time_diff_seconds); + add(LLStatViewer::FPS_8_TIME, time_diff_seconds); } if (time_diff >= 0.1) { - LLStatViewer::FPS_10_TIME.add(time_diff_seconds); + add(LLStatViewer::FPS_10_TIME, time_diff_seconds); } if (gFrameCount && mLastTimeDiff > 0.0) { // new "stutter" meter - LLStatViewer::FRAMETIME_DOUBLED.add(time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); + add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - LLStatViewer::FRAMETIME_JITTER.sample(mLastTimeDiff - time_diff); + sample(LLStatViewer::FRAMETIME_JITTER, LLTrace::Milliseconds(mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - LLStatViewer::FRAMETIME_SLEW.sample(average_frametime - time_diff); + sample(LLStatViewer::FRAMETIME_SLEW, LLTrace::Milliseconds(average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - LLStatViewer::DELTA_BANDWIDTH.sample(delta_bandwidth); - LLStatViewer::MAX_BANDWIDTH.sample(max_bandwidth); + sample(LLStatViewer::DELTA_BANDWIDTH, LLTrace::Bits(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, LLTrace::Bits(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -311,53 +311,53 @@ void update_statistics() { if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) { - LLStatViewer::MOUSELOOK_TIME.add(gFrameIntervalSeconds); + add(LLStatViewer::MOUSELOOK_TIME, gFrameIntervalSeconds); } else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) { - LLStatViewer::AVATAR_EDIT_TIME.add(gFrameIntervalSeconds); + add(LLStatViewer::AVATAR_EDIT_TIME, gFrameIntervalSeconds); } else if (LLFloaterReg::instanceVisible("build")) { - LLStatViewer::TOOLBOX_TIME.add(gFrameIntervalSeconds); + add(LLStatViewer::TOOLBOX_TIME, gFrameIntervalSeconds); } } - LLStatViewer::ENABLE_VBO.sample((F64)gSavedSettings.getBOOL("RenderVBOEnable")); - LLStatViewer::LIGHTING_DETAIL.sample((F64)gPipeline.getLightingDetail()); - LLStatViewer::DRAW_DISTANCE.sample((F64)gSavedSettings.getF32("RenderFarClip")); - LLStatViewer::CHAT_BUBBLES.sample((F64)gSavedSettings.getBOOL("UseChatBubbles")); + sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); + sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); + sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); + sample(LLStatViewer::CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); - LLStatViewer::FRAME_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Frame")); + sample(LLStatViewer::FRAME_STACKTIME, 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); - LLStatViewer::NETWORK_STACKTIME.sample(network_secs); - LLStatViewer::IMAGE_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Update Images")); - LLStatViewer::REBUILD_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Sort Draw State")); - LLStatViewer::RENDER_STACKTIME.sample(gDebugView->mFastTimerView->getTime("Geometry")); + sample(LLStatViewer::UPDATE_STACKTIME, LLTrace::Seconds(idle_secs - network_secs)); + sample(LLStatViewer::NETWORK_STACKTIME, LLTrace::Seconds(network_secs)); + sample(LLStatViewer::IMAGE_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Update Images"))); + sample(LLStatViewer::REBUILD_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Sort Draw State"))); + sample(LLStatViewer::RENDER_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Geometry"))); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - LLStatViewer::SIM_PING.sample(cdp->getPingDelay()); + sample(LLStatViewer::SIM_PING, LLTrace::Milliseconds(cdp->getPingDelay())); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLStatViewer::SIM_PING.sample(10); + sample(LLStatViewer::SIM_PING, LLTrace::Seconds(10)); } - LLStatViewer::FPS.add(1); + add(LLStatViewer::FPS, 1); if (LLTrace::get_frame_recording().getTotalRecording().getSampleCount(LLStatViewer::FPS)) { - LLStatViewer::FPS_SAMPLE.sample(LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); + sample(LLStatViewer::FPS_SAMPLE, LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); } F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - LLStatViewer::LAYERS_KBIT.add(layer_bits); - LLStatViewer::OBJECT_KBIT.add(gObjectData); - LLStatViewer::PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); - LLStatViewer::ASSET_KBIT.add(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); + add(LLStatViewer::LAYERS_KBIT, LLTrace::Bits(layer_bits)); + add(LLStatViewer::OBJECT_KBIT, gObjectData); + sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); + add(LLStatViewer::ASSET_KBIT, LLTrace::Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -378,7 +378,7 @@ void update_statistics() visible_avatar_frames = 1.f; 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); + sample(LLStatViewer::VISIBLE_AVATARS, (F64)avg_visible_avatars); } LLWorld::getInstance()->updateNetStats(); LLWorld::getInstance()->requestCacheMisses(); -- cgit v1.2.3 From 8de397b19ec9e2f6206fd5ae57dba96c70e78b74 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 18 Mar 2013 08:43:03 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics changed LLCriticalDamp to LLSmoothInterpolation and sped up interpolator lookup improvements to stats display of llstatbar added scene load stats floater accessed with ctrl|shift|2 --- indra/newview/llviewerstats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 921c681e2a..0e2c53ee5b 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -88,7 +88,8 @@ LLTrace::CountStatHandle<> FPS("fpsstat"), KILLED("killed", "Number of times killed"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), TEX_BAKES("texbakes"), - TEX_REBAKES("texrebakes"); + TEX_REBAKES("texrebakes"), + NUM_NEW_OBJECTS("numnewobjectsstat"); LLTrace::CountStatHandle KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), @@ -133,7 +134,6 @@ LLTrace::MeasurementStatHandle<> FPS_SAMPLE("fpssample"), NUM_RAW_IMAGES("numrawimagesstat"), NUM_OBJECTS("numobjectsstat"), NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_NEW_OBJECTS("numnewobjectsstat"), NUM_SIZE_CULLED("numsizeculledstat"), NUM_VIS_CULLED("numvisculledstat"), ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), -- cgit v1.2.3 From 07ca6fce7c9cffe1b8f215f25bb826fedf57a5b7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Apr 2013 21:51:56 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed PeriodicRecording::getTotalRecording as it was showing up at the top on the profiler renamed getPrevRecordingPeriod, etc. to getPrevRecording --- indra/newview/llviewerstats.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index fa4eb73180..13a005dcbf 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -348,11 +348,12 @@ void update_statistics() sample(LLStatViewer::SIM_PING, LLTrace::Seconds(10)); } - add(LLStatViewer::FPS, 1); - if (LLTrace::get_frame_recording().getTotalRecording().getSampleCount(LLStatViewer::FPS)) + if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) { - sample(LLStatViewer::FPS_SAMPLE, LLTrace::get_frame_recording().getTotalRecording().getPerSec(LLStatViewer::FPS)); + sample(LLStatViewer::FPS_SAMPLE, LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::FPS)); } + add(LLStatViewer::FPS, 1); + F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); add(LLStatViewer::LAYERS_KBIT, LLTrace::Bits(layer_bits)); add(LLStatViewer::OBJECT_KBIT, gObjectData); -- cgit v1.2.3 From fbce0030494ccb6fa8f6cf45e1ec95a2fa922bcd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 20 May 2013 12:47:23 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics killed LLFastTimerView::getTime fixed block time stats always being 0 --- indra/newview/llviewerstats.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 13a005dcbf..002f0c7aa3 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -322,19 +322,24 @@ void update_statistics() add(LLStatViewer::TOOLBOX_TIME, gFrameIntervalSeconds); } } + + LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); + sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); sample(LLStatViewer::CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); - sample(LLStatViewer::FRAME_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Frame"))); - F64 idle_secs = gDebugView->mFastTimerView->getTime("Idle"); - F64 network_secs = gDebugView->mFastTimerView->getTime("Network"); - sample(LLStatViewer::UPDATE_STACKTIME, LLTrace::Seconds(idle_secs - network_secs)); - sample(LLStatViewer::NETWORK_STACKTIME, LLTrace::Seconds(network_secs)); - sample(LLStatViewer::IMAGE_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Update Images"))); - sample(LLStatViewer::REBUILD_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Sort Draw State"))); - sample(LLStatViewer::RENDER_STACKTIME, LLTrace::Seconds(gDebugView->mFastTimerView->getTime("Geometry"))); + typedef LLInstanceTracker, std::string> trace_type_t; + + sample(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame")).as()); + LLUnit idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + LLUnit network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + sample(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); + sample(LLStatViewer::NETWORK_STACKTIME, network_secs); + sample(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Update Images")).as()); + sample(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Sort Draw State")).as()); + sample(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Render Geometry")).as()); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) -- cgit v1.2.3 From ab5106535758393e02b075d1e404e4e1fcf81abf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 20 May 2013 19:27:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed extra dereference for copy on write pointer moved copyonwrite mechanism to RecordingBuffers from individual buffer fixed logic that was leaving scene unfrozen when camera moved during metrics gathering --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 002f0c7aa3..e8196e9655 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -64,7 +64,7 @@ namespace LLStatViewer { -LLTrace::CountStatHandle<> FPS("fpsstat"), +LLTrace::CountStatHandle<> FPS("framesrendered"), PACKETS_IN("packetsinstat"), PACKETS_LOST("packetsloststat"), PACKETS_OUT("packetsoutstat"), -- cgit v1.2.3 From 9ae76d12157641033431381959ef4f798a119b8d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 29 May 2013 17:00:50 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed copy construction behavior of Recordings to not zero out data split measurement into event and sample, with sample representing a continuous function --- indra/newview/llviewerstats.cpp | 125 ++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 61 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index e8196e9655..635611c02e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -74,7 +74,6 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), IM_COUNT("imcount", "IMs sent"), OBJECT_CREATE("objectcreate"), OBJECT_REZ("objectrez", "Object rez count"), - LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"), LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), LSL_SAVES("lslsaves", "Number of times user has saved a script"), ANIMATION_UPLOADS("animationuploads", "Animations uploaded"), @@ -98,13 +97,7 @@ LLTrace::CountStatHandle KBIT("kbitstat"), ACTUAL_IN_KBIT("actualinkbitstat"), ACTUAL_OUT_KBIT("actualoutkbitstat"); -LLTrace::CountStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), - TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), - MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), - FPS_10_TIME("fps10time", "Seconds below 10 FPS"), - FPS_8_TIME("fps8time", "Seconds below 8 FPS"), - FPS_2_TIME("fps2time", "Seconds below 2 FPS"), - SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), +LLTrace::CountStatHandle SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -129,36 +122,34 @@ SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DIL SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); -LLTrace::MeasurementStatHandle<> FPS_SAMPLE("fpssample"), - NUM_IMAGES("numimagesstat"), - NUM_RAW_IMAGES("numrawimagesstat"), - NUM_OBJECTS("numobjectsstat"), - NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_SIZE_CULLED("numsizeculledstat"), - NUM_VIS_CULLED("numvisculledstat"), - ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), - LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), - VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), - SHADER_OBJECTS("shaderobjects", "Object Shaders"), - DRAW_DISTANCE("drawdistance", "Draw Distance"), - CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"), - PENDING_VFS_OPERATIONS("vfspendingoperations"), - PACKETS_LOST_PERCENT("packetslostpercentstat"), - WINDOW_WIDTH("windowwidth", "Window width"), - WINDOW_HEIGHT("windowheight", "Window height"); +LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), + NUM_IMAGES("numimagesstat"), + NUM_RAW_IMAGES("numrawimagesstat"), + NUM_OBJECTS("numobjectsstat"), + NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), + NUM_SIZE_CULLED("numsizeculledstat"), + NUM_VIS_CULLED("numvisculledstat"), + ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), + LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), + VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), + SHADER_OBJECTS("shaderobjects", "Object Shaders"), + DRAW_DISTANCE("drawdistance", "Draw Distance"), + PENDING_VFS_OPERATIONS("vfspendingoperations"), + PACKETS_LOST_PERCENT("packetslostpercentstat"), + WINDOW_WIDTH("windowwidth", "Window width"), + WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::MeasurementStatHandle AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); - -LLTrace::MeasurementStatHandle GL_TEX_MEM("gltexmemstat"), - GL_BOUND_MEM("glboundmemstat"), - RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"), - DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), - MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); +LLTrace::SampleStatHandle GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"), + DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -173,21 +164,32 @@ SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), +SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +LLTrace::SampleStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + SIM_PING("simpingstat"); + +LLTrace::EventStatHandle AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); + +LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); + +LLTrace::EventStatHandle REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); + +LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"); -LLTrace::MeasurementStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), - REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), - FRAME_STACKTIME("framestacktime", "FRAME_SECS"), - UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), - NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), - IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), - REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), - RENDER_STACKTIME("renderstacktime", "RENDER_SECS"), - SIM_PING("simpingstat"); } @@ -230,15 +232,15 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) if (time_diff >= 0.5) { - add(LLStatViewer::FPS_2_TIME, time_diff_seconds); + record(LLStatViewer::FPS_2_TIME, time_diff_seconds); } if (time_diff >= 0.125) { - add(LLStatViewer::FPS_8_TIME, time_diff_seconds); + record(LLStatViewer::FPS_8_TIME, time_diff_seconds); } if (time_diff >= 0.1) { - add(LLStatViewer::FPS_10_TIME, time_diff_seconds); + record(LLStatViewer::FPS_10_TIME, time_diff_seconds); } if (gFrameCount && mLastTimeDiff > 0.0) @@ -311,35 +313,36 @@ void update_statistics() { if (gAgentCamera.getCameraMode() == CAMERA_MODE_MOUSELOOK) { - add(LLStatViewer::MOUSELOOK_TIME, gFrameIntervalSeconds); + record(LLStatViewer::MOUSELOOK_TIME, gFrameIntervalSeconds); } else if (gAgentCamera.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) { - add(LLStatViewer::AVATAR_EDIT_TIME, gFrameIntervalSeconds); + record(LLStatViewer::AVATAR_EDIT_TIME, gFrameIntervalSeconds); } else if (LLFloaterReg::instanceVisible("build")) { - add(LLStatViewer::TOOLBOX_TIME, gFrameIntervalSeconds); + record(LLStatViewer::TOOLBOX_TIME, gFrameIntervalSeconds); } } LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); - sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); + sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); - sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); - sample(LLStatViewer::CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); + sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); + sample(LLStatViewer::CHAT_BUBBLES, gSavedSettings.getBOOL("UseChatBubbles")); typedef LLInstanceTracker, std::string> trace_type_t; - sample(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame")).as()); LLUnit idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); LLUnit network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); - sample(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); - sample(LLStatViewer::NETWORK_STACKTIME, network_secs); - sample(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Update Images")).as()); - sample(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Sort Draw State")).as()); - sample(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Render Geometry")).as()); + + record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); + record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); + record(LLStatViewer::NETWORK_STACKTIME, network_secs); + record(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Update Images"))); + record(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Sort Draw State"))); + record(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Render Geometry"))); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) -- cgit v1.2.3 From aa7024ffbacdd9e8ac0bfaca86d54f2dd9e1dda7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 31 May 2013 23:41:30 -0700 Subject: BUILDFIX - const correctness --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 635611c02e..06a53787e7 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -263,7 +263,7 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) mLastTimeDiff = time_diff; } -void LLViewerStats::addToMessage(LLSD &body) const +void LLViewerStats::addToMessage(LLSD &body) { LLSD &misc = body["misc"]; -- cgit v1.2.3 From a74b5dfa923f8eeccc9b786143f0f832de3ad450 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 4 Jun 2013 19:45:33 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed mem stat tracking...now properly tracks memory footprint with floating point precision cleaned up macros for unit declaration renamed units to SI standard for 1024 multiples (kibibytes, etc) fixed units output for scene monitor dump --- indra/newview/llviewerstats.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 06a53787e7..d29d1ebe5f 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,7 +89,7 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"), NUM_NEW_OBJECTS("numnewobjectsstat"); -LLTrace::CountStatHandle KBIT("kbitstat"), +LLTrace::CountStatHandle KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), @@ -552,9 +552,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLTrace::Kilobytes(gTotalWorldData).value(); - download["object_kbytes"] = LLTrace::Kilobytes(gTotalObjectData).value(); - download["texture_kbytes"] = LLTrace::Kilobytes(gTotalTextureData).value(); + download["world_kbytes"] = LLTrace::Kibibytes(gTotalWorldData).value(); + download["object_kbytes"] = LLTrace::Kibibytes(gTotalObjectData).value(); + download["texture_kbytes"] = LLTrace::Kibibytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; -- cgit v1.2.3 From 9fd3af3c389ed491b515cbb5136b344b069913e4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 13 Jun 2013 15:29:15 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics changed Units macros and argument order to make it more clear optimized units for integer types fixed merging of periodicrecordings...should eliminate duplicate entries in sceneloadmonitor history --- indra/newview/llviewerstats.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index be477f7f9a..7ddee48b38 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -290,13 +290,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnit gTotalWorldData = 0, +LLUnit gTotalWorldData = 0, gTotalObjectData = 0, gTotalTextureData = 0; U32 gSimPingCount = 0; -LLUnit gObjectData = 0; +LLUnit gObjectData = 0; F32 gAvgSimPing = 0.f; -LLUnit gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnit gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; @@ -334,8 +334,8 @@ void update_statistics() typedef LLInstanceTracker, std::string> trace_type_t; - LLUnit idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - LLUnit network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + LLUnit idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + LLUnit network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); -- cgit v1.2.3 From fe3cfb30d504155850ddf3752d2f55e6311990d6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sat, 22 Jun 2013 00:34:25 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed LLTrace unit typedefs --- indra/newview/llviewerstats.cpp | 84 ++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 7ddee48b38..3d4c75cec3 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,17 +89,17 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"), NUM_NEW_OBJECTS("numnewobjectsstat"); -LLTrace::CountStatHandle KBIT("kbitstat"), - LAYERS_KBIT("layerskbitstat"), - OBJECT_KBIT("objectkbitstat"), - ASSET_KBIT("assetkbitstat"), - TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbitstat"), - ACTUAL_OUT_KBIT("actualoutkbitstat"); - -LLTrace::CountStatHandle SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), - LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); +LLTrace::CountStatHandle > KBIT("kbitstat"), + LAYERS_KBIT("layerskbitstat"), + OBJECT_KBIT("objectkbitstat"), + ASSET_KBIT("assetkbitstat"), + TEXTURE_KBIT("texturekbitstat"), + ACTUAL_IN_KBIT("actualinkbitstat"), + ACTUAL_OUT_KBIT("actualoutkbitstat"); + +LLTrace::CountStatHandle > SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DILATION), SIM_FPS("simfps", "", LL_SIM_STAT_FPS), @@ -141,15 +141,15 @@ LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle GL_TEX_MEM("gltexmemstat"), - GL_BOUND_MEM("glboundmemstat"), - RAW_MEM("rawmemstat"), - FORMATTED_MEM("formattedmemstat"), - DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), - MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); +LLTrace::SampleStatHandle > GL_TEX_MEM("gltexmemstat"), + GL_BOUND_MEM("glboundmemstat"), + RAW_MEM("rawmemstat"), + FORMATTED_MEM("formattedmemstat"); +LLTrace::SampleStatHandle > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), + MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -164,18 +164,18 @@ SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), - SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), + SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), SIM_PING("simpingstat"); -LLTrace::EventStatHandle AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +LLTrace::EventStatHandle > AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), FRAME_STACKTIME("framestacktime", "FRAME_SECS"), UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -183,12 +183,12 @@ LLTrace::EventStatHandle REGION_CROSSING_TIME("regioncros REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), - TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), - MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), - FPS_10_TIME("fps10time", "Seconds below 10 FPS"), - FPS_8_TIME("fps8time", "Seconds below 8 FPS"), - FPS_2_TIME("fps2time", "Seconds below 2 FPS"); +LLTrace::EventStatHandle > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), + TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), + MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), + FPS_10_TIME("fps10time", "Seconds below 10 FPS"), + FPS_8_TIME("fps8time", "Seconds below 8 FPS"), + FPS_2_TIME("fps2time", "Seconds below 2 FPS"); } @@ -211,7 +211,7 @@ void LLViewerStats::resetStats() void LLViewerStats::updateFrameStats(const F64 time_diff) { - LLTrace::Seconds time_diff_seconds(time_diff); + LLUnit time_diff_seconds(time_diff); if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff_seconds); @@ -249,15 +249,15 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, LLTrace::Milliseconds(mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, LLUnit (mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - sample(LLStatViewer::FRAMETIME_SLEW, LLTrace::Milliseconds(average_frametime - time_diff)); + sample(LLStatViewer::FRAMETIME_SLEW, LLUnit (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - sample(LLStatViewer::DELTA_BANDWIDTH, LLTrace::Bits(delta_bandwidth)); - sample(LLStatViewer::MAX_BANDWIDTH, LLTrace::Bits(max_bandwidth)); + sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, LLUnit(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -347,13 +347,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - sample(LLStatViewer::SIM_PING, LLTrace::Milliseconds(cdp->getPingDelay())); + sample(LLStatViewer::SIM_PING, LLUnit (cdp->getPingDelay())); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - sample(LLStatViewer::SIM_PING, LLTrace::Seconds(10)); + sample(LLStatViewer::SIM_PING, LLUnit(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -363,10 +363,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_KBIT, LLTrace::Bits(layer_bits)); + add(LLStatViewer::LAYERS_KBIT, LLUnit(layer_bits)); add(LLStatViewer::OBJECT_KBIT, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_KBIT, LLTrace::Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_KBIT, LLUnit(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -403,7 +403,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); + gTotalTextureData = LLUnit(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); texture_stats_timer.reset(); } } @@ -552,9 +552,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLTrace::Kibibytes(gTotalWorldData).value(); - download["object_kbytes"] = LLTrace::Kibibytes(gTotalObjectData).value(); - download["texture_kbytes"] = LLTrace::Kibibytes(gTotalTextureData).value(); + download["world_kbytes"] = LLUnit(gTotalWorldData).value(); + download["object_kbytes"] = LLUnit(gTotalObjectData).value(); + download["texture_kbytes"] = LLUnit(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; -- cgit v1.2.3 From ffa7123bb5187e1da491a8f475d696053d9c9ee4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Jun 2013 20:45:20 -0700 Subject: SH-4299 FIX Interesting: High fps shown temporarily off scale in statistics console added ability to force uniqueness of LLCopyOnWritePointer converted more variables to units added convenience function for unit constants --- indra/newview/llviewerstats.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 3d4c75cec3..244c150b29 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -291,9 +291,9 @@ F32 gAveLandCompression = 0.f, gWorstWaterCompression = 0.f; LLUnit gTotalWorldData = 0, - gTotalObjectData = 0, - gTotalTextureData = 0; -U32 gSimPingCount = 0; + gTotalObjectData = 0, + gTotalTextureData = 0; +U32 gSimPingCount = 0; LLUnit gObjectData = 0; F32 gAvgSimPing = 0.f; LLUnit gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; @@ -353,7 +353,7 @@ void update_statistics() } else { - sample(LLStatViewer::SIM_PING, LLUnit(10)); + sample(LLStatViewer::SIM_PING, LLUnits::Seconds::fromValue(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -403,7 +403,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLUnit(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)); + gTotalTextureData = LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT); texture_stats_timer.reset(); } } -- cgit v1.2.3 From d122318bef2ff0eced7641dc24f411f792bd2935 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 8 Jul 2013 00:55:17 -0700 Subject: SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console added percentage/ratio units added auto-range and auto tick calculation to stat bar to automate display stats --- indra/newview/llviewerstats.cpp | 122 ++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 66 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 244c150b29..d753619daa 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -64,15 +64,14 @@ namespace LLStatViewer { -LLTrace::CountStatHandle<> FPS("framesrendered"), - PACKETS_IN("packetsinstat"), - PACKETS_LOST("packetsloststat"), - PACKETS_OUT("packetsoutstat"), - TEXTURE_PACKETS("texturepacketsstat"), - TRIANGLES_DRAWN("trianglesdrawnstat"), +LLTrace::CountStatHandle<> FPS("FPS", "Frames rendered"), + PACKETS_IN("Packets In", "Packets received"), + PACKETS_LOST("packetsloststat", "Packets lost"), + PACKETS_OUT("packetsoutstat", "Packets sent"), + TEXTURE_PACKETS("texturepacketsstat", "Texture data packets received"), CHAT_COUNT("chatcount", "Chat messages sent"), IM_COUNT("imcount", "IMs sent"), - OBJECT_CREATE("objectcreate"), + OBJECT_CREATE("objectcreate", "Number of objects created"), OBJECT_REZ("objectrez", "Object rez count"), LOGIN_TIMEOUTS("logintimeouts", "Number of login attempts that timed out"), LSL_SAVES("lslsaves", "Number of times user has saved a script"), @@ -86,34 +85,35 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), EDIT_TEXTURE("edittexture", "Changes to textures on objects"), KILLED("killed", "Number of times killed"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), - TEX_BAKES("texbakes"), - TEX_REBAKES("texrebakes"), - NUM_NEW_OBJECTS("numnewobjectsstat"); -LLTrace::CountStatHandle > KBIT("kbitstat"), - LAYERS_KBIT("layerskbitstat"), - OBJECT_KBIT("objectkbitstat"), - ASSET_KBIT("assetkbitstat"), - TEXTURE_KBIT("texturekbitstat"), - ACTUAL_IN_KBIT("actualinkbitstat"), - ACTUAL_OUT_KBIT("actualoutkbitstat"); + TEX_BAKES("texbakes", "Number of times avatar textures have been baked"), + TEX_REBAKES("texrebakes", "Number of times avatar textures have been forced to rebake"), + NUM_NEW_OBJECTS("numnewobjectsstat", "Number of objects in scene that were not previously in cache"); + +LLTrace::CountStatHandle > TRIANGLES_DRAWN("trianglesdrawnstat"); + +LLTrace::CountStatHandle > KBIT("Bandwidth", "Network data received"), + LAYERS_KBIT("layerskbitstat", "Network data received for layer data (terrain)"), + OBJECT_KBIT("objectkbitstat", "Network data received for objects"), + ASSET_KBIT("assetkbitstat", "Network data received for assets (animations, sounds)"), + TEXTURE_KBIT("texturekbitstat", "Network data received for textures"), + ACTUAL_IN_KBIT("actualinkbitstat", "Incoming network data"), + ACTUAL_OUT_KBIT("actualoutkbitstat", "Outgoing network data"); LLTrace::CountStatHandle > SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); -SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DILATION), - SIM_FPS("simfps", "", LL_SIM_STAT_FPS), - SIM_PHYSICS_FPS("simphysicsfps", "", LL_SIM_STAT_PHYSFPS), +SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "Simulator time scale", LL_SIM_STAT_TIME_DILATION), + SIM_FPS("simfps", "Simulator framerate", LL_SIM_STAT_FPS), + SIM_PHYSICS_FPS("simphysicsfps", "Simulator physics framerate", LL_SIM_STAT_PHYSFPS), SIM_AGENT_UPS("simagentups", "", LL_SIM_STAT_AGENTUPS), SIM_SCRIPT_EPS("simscripteps", "", LL_SIM_STAT_SCRIPT_EPS), SIM_SKIPPED_SILHOUETTE("simsimskippedsilhouettesteps", "", LL_SIM_STAT_SKIPPEDAISILSTEPS_PS), - SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS), - SIM_MAIN_AGENTS("simmainagents", "", LL_SIM_STAT_NUMAGENTMAIN), - SIM_CHILD_AGENTS("simchildagents", "", LL_SIM_STAT_NUMAGENTCHILD), + SIM_MAIN_AGENTS("simmainagents", "Number of avatars in current region", LL_SIM_STAT_NUMAGENTMAIN), + SIM_CHILD_AGENTS("simchildagents", "Number of avatars in neighboring regions", LL_SIM_STAT_NUMAGENTCHILD), SIM_OBJECTS("simobjects", "", LL_SIM_STAT_NUMTASKS), - SIM_ACTIVE_OBJECTS("simactiveobjects", "", LL_SIM_STAT_NUMTASKSACTIVE), - SIM_ACTIVE_SCRIPTS("simactivescripts", "", LL_SIM_STAT_NUMSCRIPTSACTIVE), - SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN), + SIM_ACTIVE_OBJECTS("simactiveobjects", "Number of scripted and/or mocing objects", LL_SIM_STAT_NUMTASKSACTIVE), + SIM_ACTIVE_SCRIPTS("simactivescripts", "Number of scripted objects", LL_SIM_STAT_NUMSCRIPTSACTIVE), SIM_IN_PACKETS_PER_SEC("siminpps", "", LL_SIM_STAT_INPPS), SIM_OUT_PACKETS_PER_SEC("simoutpps", "", LL_SIM_STAT_OUTPPS), SIM_PENDING_DOWNLOADS("simpendingdownloads", "", LL_SIM_STAT_PENDING_DOWNLOADS), @@ -122,23 +122,25 @@ SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "", LL_SIM_STAT_TIME_DIL SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); +SimMeasurement > SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN), + SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS); + LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), NUM_IMAGES("numimagesstat"), NUM_RAW_IMAGES("numrawimagesstat"), NUM_OBJECTS("numobjectsstat"), NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_SIZE_CULLED("numsizeculledstat"), - NUM_VIS_CULLED("numvisculledstat"), ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), LIGHTING_DETAIL("lightingdetail", "Lighting Detail"), VISIBLE_AVATARS("visibleavatars", "Visible Avatars"), SHADER_OBJECTS("shaderobjects", "Object Shaders"), DRAW_DISTANCE("drawdistance", "Draw Distance"), PENDING_VFS_OPERATIONS("vfspendingoperations"), - PACKETS_LOST_PERCENT("packetslostpercentstat"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); - + +LLTrace::SampleStatHandle > PACKETS_LOST_PERCENT("packetslostpercentstat"); + static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); LLTrace::SampleStatHandle > GL_TEX_MEM("gltexmemstat"), @@ -150,38 +152,38 @@ LLTrace::SampleStatHandle > DELTA_BANDWIDTH("del SimMeasurement > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), - SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), - SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), - SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), - SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec", "", LL_SIM_STAT_SIMPHYSICSSTEPMS), - SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec", "", LL_SIM_STAT_SIMPHYSICSSHAPEMS), - SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec", "", LL_SIM_STAT_SIMPHYSICSOTHERMS), - SIM_AI_TIME("simsimaistepmsec", "", LL_SIM_STAT_SIMAISTEPTIMEMS), - SIM_AGENTS_TIME("simagentmsec", "", LL_SIM_STAT_AGENTMS), - SIM_IMAGES_TIME("simimagesmsec", "", LL_SIM_STAT_IMAGESMS), - SIM_SCRIPTS_TIME("simscriptmsec", "", LL_SIM_STAT_SCRIPTMS), - SIM_SPARE_TIME("simsparemsec", "", LL_SIM_STAT_SIMSPARETIME), - SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), - SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); + SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), + SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), + SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), + SIM_PHYSICS_STEP_TIME("simsimphysicsstepmsec", "", LL_SIM_STAT_SIMPHYSICSSTEPMS), + SIM_PHYSICS_SHAPE_UPDATE_TIME("simsimphysicsshapeupdatemsec", "", LL_SIM_STAT_SIMPHYSICSSHAPEMS), + SIM_PHYSICS_OTHER_TIME("simsimphysicsothermsec", "", LL_SIM_STAT_SIMPHYSICSOTHERMS), + SIM_AI_TIME("simsimaistepmsec", "", LL_SIM_STAT_SIMAISTEPTIMEMS), + SIM_AGENTS_TIME("simagentmsec", "", LL_SIM_STAT_AGENTMS), + SIM_IMAGES_TIME("simimagesmsec", "", LL_SIM_STAT_IMAGESMS), + SIM_SCRIPTS_TIME("simscriptmsec", "", LL_SIM_STAT_SCRIPTMS), + SIM_SPARE_TIME("simsparemsec", "", LL_SIM_STAT_SIMSPARETIME), + SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), + SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES), - SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); +SimMeasurement > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); LLTrace::SampleStatHandle > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), - FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), - SIM_PING("simpingstat"); + FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), + SIM_PING("simpingstat"); LLTrace::EventStatHandle > AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); LLTrace::EventStatHandle > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), - FRAME_STACKTIME("framestacktime", "FRAME_SECS"), - UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), - NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), - IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), - REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), - RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); + FRAME_STACKTIME("framestacktime", "FRAME_SECS"), + UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), + NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), + IMAGE_STACKTIME("imagestacktime", "IMAGE_SECS"), + REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), + RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); LLTrace::EventStatHandle > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), @@ -189,8 +191,6 @@ LLTrace::EventStatHandle > AVATAR_EDIT_TIME("avata FPS_10_TIME("fps10time", "Seconds below 10 FPS"), FPS_8_TIME("fps8time", "Seconds below 8 FPS"), FPS_2_TIME("fps2time", "Seconds below 2 FPS"); - - } LLViewerStats::LLViewerStats() @@ -378,17 +378,7 @@ void update_statistics() gTextureTimer.unpause(); } - { - static F32 visible_avatar_frames = 0.f; - static F32 avg_visible_avatars = 0; - F32 visible_avatars = (F32)LLVOAvatar::sNumVisibleAvatars; - if (visible_avatars > 0.f) - { - visible_avatar_frames = 1.f; - avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; - } - sample(LLStatViewer::VISIBLE_AVATARS, (F64)avg_visible_avatars); - } + sample(LLStatViewer::VISIBLE_AVATARS, LLVOAvatar::sNumVisibleAvatars); LLWorld::getInstance()->updateNetStats(); LLWorld::getInstance()->requestCacheMisses(); -- cgit v1.2.3 From 11e14cd3b0f58225a96b9b7a9839a7f030fe4045 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Jul 2013 11:05:57 -0700 Subject: SH-4299Interesting: High fps shown temporarily off scale in statistics console various fixes to lltrace start() on started recording no longer resets fixed various instances of unit forgetfullness in lltrace recording split now has gapless timing scene monitor now guarantees min sample time renamed a bunch of stats added names to debug thread view on windows --- indra/newview/llviewerstats.cpp | 52 ++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index d753619daa..69a6c00a8f 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,19 +89,22 @@ LLTrace::CountStatHandle<> FPS("FPS", "Frames rendered"), TEX_REBAKES("texrebakes", "Number of times avatar textures have been forced to rebake"), NUM_NEW_OBJECTS("numnewobjectsstat", "Number of objects in scene that were not previously in cache"); -LLTrace::CountStatHandle > TRIANGLES_DRAWN("trianglesdrawnstat"); - -LLTrace::CountStatHandle > KBIT("Bandwidth", "Network data received"), - LAYERS_KBIT("layerskbitstat", "Network data received for layer data (terrain)"), - OBJECT_KBIT("objectkbitstat", "Network data received for objects"), - ASSET_KBIT("assetkbitstat", "Network data received for assets (animations, sounds)"), - TEXTURE_KBIT("texturekbitstat", "Network data received for textures"), - ACTUAL_IN_KBIT("actualinkbitstat", "Incoming network data"), - ACTUAL_OUT_KBIT("actualoutkbitstat", "Outgoing network data"); - -LLTrace::CountStatHandle > SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), - SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), - LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); +LLTrace::CountStatHandle > + TRIANGLES_DRAWN("trianglesdrawnstat"); + +LLTrace::CountStatHandle > + ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), + LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), + OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), + ASSET_UDP_DATA_RECEIVED("assetudpdatareceived", "Network data received for assets (animations, sounds) over UDP message system"), + TEXTURE_NETWORK_DATA_RECEIVED("texturedatareceived", "Network data received for textures"), + MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"), + MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); + +LLTrace::CountStatHandle > + SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), + SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), + LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "Simulator time scale", LL_SIM_STAT_TIME_DILATION), SIM_FPS("simfps", "Simulator framerate", LL_SIM_STAT_FPS), @@ -122,8 +125,9 @@ SimMeasurement<> SIM_TIME_DILATION("simtimedilation", "Simulator time scale", SIM_PHYSICS_PINNED_TASKS("physicspinnedtasks", "", LL_SIM_STAT_PHYSICS_PINNED_TASKS), SIM_PHYSICS_LOD_TASKS("physicslodtasks", "", LL_SIM_STAT_PHYSICS_LOD_TASKS); -SimMeasurement > SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN), - SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS); +SimMeasurement > + SIM_PERCENTAGE_SCRIPTS_RUN("simpctscriptsrun", "", LL_SIM_STAT_PCTSCRIPTSRUN), + SIM_SKIPPED_CHARACTERS_PERCENTAGE("simsimpctsteppedcharacters", "", LL_SIM_STAT_PCTSTEPPEDCHARACTERS); LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), NUM_IMAGES("numimagesstat"), @@ -139,9 +143,11 @@ LLTrace::SampleStatHandle<> FPS_SAMPLE("fpssample"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::SampleStatHandle > PACKETS_LOST_PERCENT("packetslostpercentstat"); +LLTrace::SampleStatHandle > + PACKETS_LOST_PERCENT("packetslostpercentstat"); -static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); +static LLTrace::SampleStatHandle + CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); LLTrace::SampleStatHandle > GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), @@ -197,12 +203,10 @@ LLViewerStats::LLViewerStats() : mLastTimeDiff(0.0) { mRecording.start(); - LLTrace::get_frame_recording().start(); } LLViewerStats::~LLViewerStats() -{ -} +{} void LLViewerStats::resetStats() { @@ -363,10 +367,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_KBIT, LLUnit(layer_bits)); - add(LLStatViewer::OBJECT_KBIT, gObjectData); + add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, LLUnit(layer_bits)); + add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_KBIT, LLUnit(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, LLUnit(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -393,7 +397,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureData = LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT); + gTotalTextureData = LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED); texture_stats_timer.reset(); } } -- cgit v1.2.3 From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/newview/llviewerstats.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 69a6c00a8f..94be8e2a83 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -92,6 +92,9 @@ LLTrace::CountStatHandle<> FPS("FPS", "Frames rendered"), LLTrace::CountStatHandle > TRIANGLES_DRAWN("trianglesdrawnstat"); +LLTrace::EventStatHandle > + TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); + LLTrace::CountStatHandle > ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), @@ -213,38 +216,37 @@ void LLViewerStats::resetStats() LLViewerStats::instance().mRecording.reset(); } -void LLViewerStats::updateFrameStats(const F64 time_diff) +void LLViewerStats::updateFrameStats(const LLUnit time_diff) { - LLUnit time_diff_seconds(time_diff); if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { - add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff_seconds); + add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff); } F32 sim_fps = getRecording().getLastValue(LLStatViewer::SIM_FPS); if (0.f < sim_fps && sim_fps < 20.f) { - add(LLStatViewer::SIM_20_FPS_TIME, time_diff_seconds); + add(LLStatViewer::SIM_20_FPS_TIME, time_diff); } F32 sim_physics_fps = getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS); if (0.f < sim_physics_fps && sim_physics_fps < 20.f) { - add(LLStatViewer::SIM_PHYSICS_20_FPS_TIME, time_diff_seconds); + add(LLStatViewer::SIM_PHYSICS_20_FPS_TIME, time_diff); } if (time_diff >= 0.5) { - record(LLStatViewer::FPS_2_TIME, time_diff_seconds); + record(LLStatViewer::FPS_2_TIME, time_diff); } if (time_diff >= 0.125) { - record(LLStatViewer::FPS_8_TIME, time_diff_seconds); + record(LLStatViewer::FPS_8_TIME, time_diff); } if (time_diff >= 0.1) { - record(LLStatViewer::FPS_10_TIME, time_diff_seconds); + record(LLStatViewer::FPS_10_TIME, time_diff); } if (gFrameCount && mLastTimeDiff > 0.0) @@ -331,6 +333,8 @@ void update_statistics() LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); + record(LLStatViewer::TRIANGLES_DRAWN_PER_FRAME, last_frame_recording.getSum(LLStatViewer::TRIANGLES_DRAWN)); + sample(LLStatViewer::ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); -- cgit v1.2.3 From e87ba587555d2a70e87dd0b204be2d586920d50f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 31 Jul 2013 14:49:12 -0700 Subject: BUILDFIX: bad argument to llformat --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 94be8e2a83..69198ed53d 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -593,7 +593,7 @@ void send_stats() S32 window_height = gViewerWindow->getWindowHeightRaw(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); - misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds); + misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); // misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 // misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 -- cgit v1.2.3 From ddef4d7ff74ecff49e76afca58d1d3c2486e8af3 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 6 Aug 2013 16:35:46 -0600 Subject: revert some LLUnit changes to temporarily fix SH-4399: Interesting: Texture console MB Bound 0/384 and texture queue bounces once per second --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 69198ed53d..94be8e2a83 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -593,7 +593,7 @@ void send_stats() S32 window_height = gViewerWindow->getWindowHeightRaw(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); - misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); + misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds); // misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 // misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 -- cgit v1.2.3 From 8d3daa141e9ea14f533559843d77ab5c0f715421 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 16:14:19 -0700 Subject: SH-4374 FIX Interesting: Statistics Object cache hit rate is always 100% moved object cache sampling code so that it actually gets executed default values for stats are NaN instead of 0 in many cases --- indra/newview/llviewerstats.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 69198ed53d..bb023ce422 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -200,6 +200,9 @@ LLTrace::EventStatHandle > AVATAR_EDIT_TIME("avata FPS_10_TIME("fps10time", "Seconds below 10 FPS"), FPS_8_TIME("fps8time", "Seconds below 8 FPS"), FPS_2_TIME("fps2time", "Seconds below 2 FPS"); + +LLTrace::EventStatHandle > OBJECT_CACHE_HIT_RATE("object_cache_hits"); + } LLViewerStats::LLViewerStats() -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llviewerstats.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index bb023ce422..8cb519b098 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -281,8 +281,8 @@ void LLViewerStats::addToMessage(LLSD &body) misc["Vertex Buffers Enabled"] = getRecording().getMean(LLStatViewer::ENABLE_VBO); body["AgentPositionSnaps"] = getRecording().getSum(LLStatViewer::AGENT_POSITION_SNAP).value(); //mAgentPositionSnaps.asLLSD(); - llinfos << "STAT: AgentPositionSnaps: Mean = " << getRecording().getMean(LLStatViewer::AGENT_POSITION_SNAP).value() << "; StdDev = " << getRecording().getStandardDeviation(LLStatViewer::AGENT_POSITION_SNAP).value() - << "; Count = " << getRecording().getSampleCount(LLStatViewer::AGENT_POSITION_SNAP) << llendl; + LL_INFOS() << "STAT: AgentPositionSnaps: Mean = " << getRecording().getMean(LLStatViewer::AGENT_POSITION_SNAP).value() << "; StdDev = " << getRecording().getStandardDeviation(LLStatViewer::AGENT_POSITION_SNAP).value() + << "; Count = " << getRecording().getSampleCount(LLStatViewer::AGENT_POSITION_SNAP) << LL_ENDL; } // *NOTE:Mani The following methods used to exist in viewer.cpp @@ -417,13 +417,13 @@ public: void error(U32 statusNum, const std::string& reason) { - llinfos << "ViewerStatsResponder::error " << statusNum << " " - << reason << llendl; + LL_INFOS() << "ViewerStatsResponder::error " << statusNum << " " + << reason << LL_ENDL; } void result(const LLSD& content) { - llinfos << "ViewerStatsResponder::result" << llendl; + LL_INFOS() << "ViewerStatsResponder::result" << LL_ENDL; } }; @@ -453,7 +453,7 @@ void send_stats() std::string url = gAgent.getRegion()->getCapability("ViewerStats"); if (url.empty()) { - llwarns << "Could not get ViewerStats capability" << llendl; + LL_WARNS() << "Could not get ViewerStats capability" << LL_ENDL; return; } @@ -606,8 +606,8 @@ void send_stats() F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds; misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22 - llinfos << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << llendl; - llinfos << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << llendl; + LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL; + LL_INFOS() << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << LL_ENDL; body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames"); body["DisplayNamesShowUsername"] = gSavedSettings.getBOOL("NameTagShowUsernames"); @@ -633,7 +633,7 @@ LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_na void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) { LLFrameTimer& timer = getPhaseTimer(phase_name); - lldebugs << "startPhase " << phase_name << llendl; + LL_DEBUGS() << "startPhase " << phase_name << LL_ENDL; timer.unpause(); } @@ -648,14 +648,14 @@ void LLViewerStats::PhaseMap::stopAllPhases() // Going from started to paused state - record stats. recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); } - lldebugs << "stopPhase (all) " << phase_name << llendl; + LL_DEBUGS() << "stopPhase (all) " << phase_name << LL_ENDL; iter->second.pause(); } } void LLViewerStats::PhaseMap::clearPhases() { - lldebugs << "clearPhases" << llendl; + LL_DEBUGS() << "clearPhases" << LL_ENDL; mPhaseMap.clear(); } -- cgit v1.2.3 From b39cf4770b6d73de51b0ed451139bb4502f396c8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 12 Aug 2013 20:08:18 -0700 Subject: Backed out changeset: ed09997b4652 --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 06a2dad07f..8cb519b098 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -596,7 +596,7 @@ void send_stats() S32 window_height = gViewerWindow->getWindowHeightRaw(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); - misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds); + misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); // misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 // misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 -- cgit v1.2.3 From 26581404e426b00cd0a07c38b5cb858d5d5faa28 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Aug 2013 11:51:49 -0700 Subject: BUILDFIX: added header for numeric_limits support on gcc added convenience types for units F32Seconds, etc. --- indra/newview/llviewerstats.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 8cb519b098..568d4b42ca 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -104,7 +104,7 @@ LLTrace::CountStatHandle > MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"), MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); -LLTrace::CountStatHandle > +LLTrace::CountStatHandle SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -194,7 +194,7 @@ LLTrace::EventStatHandle > REGION_CROSSING_TI REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle > AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), +LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -219,7 +219,7 @@ void LLViewerStats::resetStats() LLViewerStats::instance().mRecording.reset(); } -void LLViewerStats::updateFrameStats(const LLUnit time_diff) +void LLViewerStats::updateFrameStats(const LLUnits::F64Seconds time_diff) { if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { @@ -299,13 +299,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnit gTotalWorldData = 0, - gTotalObjectData = 0, - gTotalTextureData = 0; +LLUnits::U32Bytes gTotalWorldData, + gTotalObjectData, + gTotalTextureData; U32 gSimPingCount = 0; -LLUnit gObjectData = 0; +LLUnits::U32Bits gObjectData; F32 gAvgSimPing = 0.f; -LLUnit gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnits::U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {LLUnits::U32Bytes(0)}; extern U32 gVisCompared; extern U32 gVisTested; @@ -345,8 +345,8 @@ void update_statistics() typedef LLInstanceTracker, std::string> trace_type_t; - LLUnit idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - LLUnit network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + LLUnits::F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + LLUnits::F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); @@ -364,7 +364,7 @@ void update_statistics() } else { - sample(LLStatViewer::SIM_PING, LLUnits::Seconds::fromValue(10)); + sample(LLStatViewer::SIM_PING, LLUnits::U32Seconds(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) -- cgit v1.2.3 From 9f7bfa1c3710856cd2b0a0a8a429d6c45b0fcd09 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Aug 2013 00:02:23 -0700 Subject: moved unit types out of LLUnits namespace, since they are prefixed --- indra/newview/llviewerstats.cpp | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 568d4b42ca..67005e1978 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -95,7 +95,7 @@ LLTrace::CountStatHandle > LLTrace::EventStatHandle > TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); -LLTrace::CountStatHandle > +LLTrace::CountStatHandle ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), @@ -104,7 +104,7 @@ LLTrace::CountStatHandle > MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"), MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); -LLTrace::CountStatHandle +LLTrace::CountStatHandle SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"), SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"), LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -152,15 +152,15 @@ LLTrace::SampleStatHandle > static LLTrace::SampleStatHandle CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle > GL_TEX_MEM("gltexmemstat"), +LLTrace::SampleStatHandle GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), FORMATTED_MEM("formattedmemstat"); -LLTrace::SampleStatHandle > DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), +LLTrace::SampleStatHandle DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement > SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -175,10 +175,10 @@ SimMeasurement > SIM_FRAME_TIME("simframemsec SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement > SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); -SimMeasurement > SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); +SimMeasurement SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle > FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), SIM_PING("simpingstat"); @@ -186,7 +186,7 @@ LLTrace::EventStatHandle > AGENT_POSITION_SNAP("age LLTrace::EventStatHandle<> LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle > REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), FRAME_STACKTIME("framestacktime", "FRAME_SECS"), UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"), NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -194,7 +194,7 @@ LLTrace::EventStatHandle > REGION_CROSSING_TI REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"), RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), +LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -219,7 +219,7 @@ void LLViewerStats::resetStats() LLViewerStats::instance().mRecording.reset(); } -void LLViewerStats::updateFrameStats(const LLUnits::F64Seconds time_diff) +void LLViewerStats::updateFrameStats(const F64Seconds time_diff) { if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) { @@ -258,15 +258,15 @@ void LLViewerStats::updateFrameStats(const LLUnits::F64Seconds time_diff) add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); // old stats that were never really used - sample(LLStatViewer::FRAMETIME_JITTER, LLUnit (mLastTimeDiff - time_diff)); + sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff)); F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; - sample(LLStatViewer::FRAMETIME_SLEW, LLUnit (average_frametime - time_diff)); + sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit(delta_bandwidth)); - sample(LLStatViewer::MAX_BANDWIDTH, LLUnit(max_bandwidth)); + sample(LLStatViewer::DELTA_BANDWIDTH, F64Bits(delta_bandwidth)); + sample(LLStatViewer::MAX_BANDWIDTH, F64Bits(max_bandwidth)); } mLastTimeDiff = time_diff; @@ -299,13 +299,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnits::U32Bytes gTotalWorldData, +U32Bytes gTotalWorldData, gTotalObjectData, gTotalTextureData; U32 gSimPingCount = 0; -LLUnits::U32Bits gObjectData; +U32Bits gObjectData; F32 gAvgSimPing = 0.f; -LLUnits::U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {LLUnits::U32Bytes(0)}; +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; extern U32 gVisCompared; extern U32 gVisTested; @@ -345,8 +345,8 @@ void update_statistics() typedef LLInstanceTracker, std::string> trace_type_t; - LLUnits::F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - LLUnits::F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); + F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); @@ -358,13 +358,13 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - sample(LLStatViewer::SIM_PING, LLUnit (cdp->getPingDelay())); + sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - sample(LLStatViewer::SIM_PING, LLUnits::U32Seconds(10)); + sample(LLStatViewer::SIM_PING, U32Seconds(10)); } if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -374,10 +374,10 @@ void update_statistics() add(LLStatViewer::FPS, 1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, LLUnit(layer_bits)); + add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, F64Bits(layer_bits)); add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); - add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, LLUnit(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); + add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -553,9 +553,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLUnit(gTotalWorldData).value(); - download["object_kbytes"] = LLUnit(gTotalObjectData).value(); - download["texture_kbytes"] = LLUnit(gTotalTextureData).value(); + download["world_kbytes"] = F64Kibibytes(gTotalWorldData).value(); + download["object_kbytes"] = F64Kibibytes(gTotalObjectData).value(); + download["texture_kbytes"] = F64Kibibytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; -- cgit v1.2.3 From 25937040de9a787c221aae7f178f43827c799028 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 16 Aug 2013 12:38:12 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms converted many values over to units system in effort to track down source of 0 ping --- indra/newview/llviewerstats.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 67005e1978..bb2c13df33 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -304,8 +304,8 @@ U32Bytes gTotalWorldData, gTotalTextureData; U32 gSimPingCount = 0; U32Bits gObjectData; -F32 gAvgSimPing = 0.f; -U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; +F32Milliseconds gAvgSimPing(0.f); +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; extern U32 gVisCompared; extern U32 gVisTested; @@ -359,7 +359,7 @@ void update_statistics() if (cdp) { sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); - gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); + gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay().value())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else @@ -494,14 +494,14 @@ void send_stats() gSimFrames = (F32) gFrameCount; agent["agents_in_view"] = LLVOAvatar::sNumVisibleAvatars; - agent["ping"] = gAvgSimPing; + agent["ping"] = gAvgSimPing.value(); agent["meters_traveled"] = gAgent.getDistanceTraveled(); agent["regions_visited"] = gAgent.getRegionsVisited(); agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0; LLSD &system = body["system"]; - system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB(); + system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value(); system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); system["cpu"] = gSysCPU.getCPUString(); unsigned char MACAddress[MAC_ADDRESS_BYTES]; -- cgit v1.2.3 From 612892b45a3413b16e40c49d3bfde77a4ca927fd Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 18 Aug 2013 22:30:27 -0700 Subject: SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms continued conversion to units system made units perform type promotion correctly and preserve type in arithmetic e.g. can now do LLVector3 in units added typedefs for remaining common unit types, including implicits --- indra/newview/llviewerstats.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index bb2c13df33..f300983f19 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -95,7 +95,7 @@ LLTrace::CountStatHandle > LLTrace::EventStatHandle > TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); -LLTrace::CountStatHandle +LLTrace::CountStatHandle ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"), LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"), OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), @@ -156,7 +156,7 @@ LLTrace::SampleStatHandle GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), RAW_MEM("rawmemstat"), FORMATTED_MEM("formattedmemstat"); -LLTrace::SampleStatHandle DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), +LLTrace::SampleStatHandle DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); @@ -221,7 +221,7 @@ void LLViewerStats::resetStats() void LLViewerStats::updateFrameStats(const F64Seconds time_diff) { - if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0) + if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > F32Percent(5.0)) { add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff); } @@ -239,20 +239,20 @@ void LLViewerStats::updateFrameStats(const F64Seconds time_diff) add(LLStatViewer::SIM_PHYSICS_20_FPS_TIME, time_diff); } - if (time_diff >= 0.5) + if (time_diff >= (F64Seconds)0.5) { record(LLStatViewer::FPS_2_TIME, time_diff); } - if (time_diff >= 0.125) + if (time_diff >= (F64Seconds)0.125) { record(LLStatViewer::FPS_8_TIME, time_diff); } - if (time_diff >= 0.1) + if (time_diff >= (F64Seconds)0.1) { record(LLStatViewer::FPS_10_TIME, time_diff); } - if (gFrameCount && mLastTimeDiff > 0.0) + if (gFrameCount && mLastTimeDiff > (F64Seconds)0.0) { // new "stutter" meter add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0); @@ -260,7 +260,7 @@ void LLViewerStats::updateFrameStats(const F64Seconds time_diff) // old stats that were never really used sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff)); - F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; + F32Seconds average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff)); F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); @@ -359,7 +359,7 @@ void update_statistics() if (cdp) { sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); - gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay().value())) / ((F32)gSimPingCount + 1); + gAvgSimPing = ((gAvgSimPing * gSimPingCount) + cdp->getPingDelay()) / (gSimPingCount + 1); gSimPingCount++; } else @@ -373,8 +373,8 @@ void update_statistics() } add(LLStatViewer::FPS, 1); - F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, F64Bits(layer_bits)); + F64Bits layer_bits = gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits(); + add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, layer_bits); add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData); sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); @@ -395,7 +395,7 @@ void update_statistics() // Reset all of these values. gVLManager.resetBitCounts(); - gObjectData = 0; + gObjectData = (U32Bytes)0; // gDecodedBits = 0; // Only update texture stats periodically so that they are less noisy @@ -553,9 +553,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = F64Kibibytes(gTotalWorldData).value(); - download["object_kbytes"] = F64Kibibytes(gTotalObjectData).value(); - download["texture_kbytes"] = F64Kibibytes(gTotalTextureData).value(); + download["world_kbytes"] = F64Kilobytes(gTotalWorldData).value(); + download["object_kbytes"] = F64Kilobytes(gTotalObjectData).value(); + download["texture_kbytes"] = F64Kilobytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; -- cgit v1.2.3 From 17df8988fec3f2ba991ca9e34ff8148253a2fc04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 7 Oct 2013 13:38:03 -0700 Subject: renamed TraceType to StatType added more MemTrackable types optimized memory usage of LLTrace some more --- indra/newview/llviewerstats.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f300983f19..c81a9a0ad3 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -343,17 +343,17 @@ void update_statistics() sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); sample(LLStatViewer::CHAT_BUBBLES, gSavedSettings.getBOOL("UseChatBubbles")); - typedef LLInstanceTracker, std::string> trace_type_t; + typedef LLInstanceTracker, std::string> stat_type_t; - F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); - F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); + F64Seconds idle_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Idle")); + F64Seconds network_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Network")); - record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame"))); + record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Frame"))); record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); record(LLStatViewer::NETWORK_STACKTIME, network_secs); - record(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Update Images"))); - record(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Sort Draw State"))); - record(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Render Geometry"))); + record(LLStatViewer::IMAGE_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Update Images"))); + record(LLStatViewer::REBUILD_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Sort Draw State"))); + record(LLStatViewer::RENDER_STACKTIME, last_frame_recording.getSum(*stat_type_t::getInstance("Render Geometry"))); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) -- cgit v1.2.3 From ec178690240a56ffa43b8f37c6b581c9008d3d7d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 17 Oct 2013 14:48:01 -0700 Subject: BUILDFIX: bad typedef --- indra/newview/llviewerstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index c81a9a0ad3..b5aa052a90 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -343,7 +343,7 @@ void update_statistics() sample(LLStatViewer::DRAW_DISTANCE, (F64)gSavedSettings.getF32("RenderFarClip")); sample(LLStatViewer::CHAT_BUBBLES, gSavedSettings.getBOOL("UseChatBubbles")); - typedef LLInstanceTracker, std::string> stat_type_t; + typedef LLTrace::StatType::instance_tracker_t stat_type_t; F64Seconds idle_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Idle")); F64Seconds network_secs = last_frame_recording.getSum(*stat_type_t::getInstance("Network")); -- cgit v1.2.3 From 18aedf0241ba893e12140c0a3855f328d2b4eded Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 17 Oct 2013 19:18:53 -0700 Subject: fix for assert at runtime (reading stats from recording while it was active) fix for bad values returns from getPeriodMin and getPeriodMax on count stats when no counts recorded fix for gcc compile time error (typename ftw) --- indra/newview/llviewerstats.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index b5aa052a90..d5ae2d1030 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -208,7 +208,7 @@ LLTrace::EventStatHandle > OBJECT_CACHE_HIT_RATE(" LLViewerStats::LLViewerStats() : mLastTimeDiff(0.0) { - mRecording.start(); + getRecording().start(); } LLViewerStats::~LLViewerStats() @@ -216,7 +216,7 @@ LLViewerStats::~LLViewerStats() void LLViewerStats::resetStats() { - LLViewerStats::instance().mRecording.reset(); + getRecording().reset(); } void LLViewerStats::updateFrameStats(const F64Seconds time_diff) @@ -457,6 +457,8 @@ void send_stats() return; } + LLViewerStats::instance().getRecording().pause(); + body["session_id"] = gAgentSessionID; LLSD &agent = body["agent"]; @@ -616,6 +618,8 @@ void send_stats() LLViewerStats::getInstance()->addToMessage(body); LLHTTPClient::post(url, body, new ViewerStatsResponder()); + + LLViewerStats::instance().getRecording().resume(); } LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name) -- cgit v1.2.3