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/llscenemonitor.cpp | 16 ++++++++++++++-- indra/newview/lltextureview.cpp | 12 ++++++------ indra/newview/llviewerstats.cpp | 8 ++++---- indra/newview/llviewerstats.h | 2 +- indra/newview/llviewertexture.cpp | 8 ++++---- indra/newview/llviewertexture.h | 8 ++++---- indra/newview/llviewerwindow.cpp | 2 +- 7 files changed, 34 insertions(+), 22 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index f7abb982e1..dccf8a2a17 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -554,6 +554,12 @@ void LLSceneMonitor::dumpToFile(std::string file_name) std::ostringstream row; row << it->getName(); + const char* unit_label = it->getUnitLabel(); + if(unit_label[0]) + { + row << "(" << unit_label << ")"; + } + S32 samples = 0; for (S32 frame = 0; frame < frame_count; frame++) @@ -579,6 +585,12 @@ void LLSceneMonitor::dumpToFile(std::string file_name) std::ostringstream row; row << it->getName(); + const char* unit_label = it->getUnitLabel(); + if(unit_label[0]) + { + row << "(" << unit_label << ")"; + } + S32 samples = 0; for (S32 frame = 0; frame < frame_count; frame++) @@ -600,11 +612,11 @@ void LLSceneMonitor::dumpToFile(std::string file_name) it != end_it; ++it) { - os << it->getName(); + os << it->getName() << "(KiB)"; for (S32 frame = 0; frame < frame_count; frame++) { - os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getSum(*it).value(); + os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).as().value(); } os << std::endl; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 7a6351c880..0df7b46b52 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -507,13 +507,13 @@ private: void LLGLTexMemBar::draw() { - LLUnit bound_mem = LLViewerTexture::sBoundTextureMemory; - LLUnit max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; - LLUnit total_mem = LLViewerTexture::sTotalTextureMemory; - LLUnit max_total_mem = LLViewerTexture::sMaxTotalTextureMem; + LLUnit bound_mem = LLViewerTexture::sBoundTextureMemory; + LLUnit max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + LLUnit total_mem = LLViewerTexture::sTotalTextureMemory; + LLUnit max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getUsage()).value() ; - F32 cache_max_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; + F32 cache_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ; + F32 cache_max_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); LLUnit total_texture_downloaded = gTotalTextureData; 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"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index ca8c347afa..7ad1e5d053 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -94,7 +94,7 @@ extern LLTrace::CountStatHandle<> FPS, NUM_NEW_OBJECTS; -extern LLTrace::CountStatHandle KBIT, +extern LLTrace::CountStatHandle KBIT, LAYERS_KBIT, OBJECT_KBIT, ASSET_KBIT, diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 12835002d3..a3cd2efd66 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -65,8 +65,8 @@ /////////////////////////////////////////////////////////////////////////////// // extern -const LLUnit gMinVideoRam = 32; -const LLUnit gMaxVideoRam = 512; +const LLUnit gMinVideoRam = 32; +const LLUnit gMaxVideoRam = 512; // statics @@ -89,8 +89,8 @@ F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; LLUnit LLViewerTexture::sBoundTextureMemory = 0; LLUnit LLViewerTexture::sTotalTextureMemory = 0; -LLUnit LLViewerTexture::sMaxBoundTextureMem = 0; -LLUnit LLViewerTexture::sMaxTotalTextureMem = 0; +LLUnit LLViewerTexture::sMaxBoundTextureMem = 0; +LLUnit LLViewerTexture::sMaxTotalTextureMem = 0; LLUnit LLViewerTexture::sMaxDesiredTextureMem = 0 ; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d69a0ffb72..ff1aef181b 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -39,8 +39,8 @@ #include #include -extern const LLUnit gMinVideoRam; -extern const LLUnit gMaxVideoRam; +extern const LLUnit gMinVideoRam; +extern const LLUnit gMaxVideoRam; class LLFace; class LLImageGL ; @@ -329,8 +329,8 @@ public: static F32 sDesiredDiscardScale; static LLUnit sBoundTextureMemory; static LLUnit sTotalTextureMemory; - static LLUnit sMaxBoundTextureMem; - static LLUnit sMaxTotalTextureMem; + static LLUnit sMaxBoundTextureMem; + static LLUnit sMaxTotalTextureMem; static LLUnit sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ed85667469..9523037b36 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -734,7 +734,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit(gTotalTextureBytesPerBoostLevel[i]).value())); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } -- cgit v1.2.3