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/llfasttimerview.cpp | 7 ------- indra/newview/llfasttimerview.h | 1 - indra/newview/llviewerstats.cpp | 21 +++++++++++++-------- 3 files changed, 13 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 45ffe56ac1..b78dd08bf1 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -422,13 +422,6 @@ void LLFastTimerView::draw() mHoverBarIndex = -1; } -F64 LLFastTimerView::getTime(const std::string& name) -{ - //TODO: replace calls to this with use of timer object directly - //llstatic_assert(false, "TODO: implement"); - return 0.0; -} - void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch) { //read result back into raw image diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 8b9ad290bc..341adacd65 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -62,7 +62,6 @@ public: virtual void draw(); LLTrace::TimeBlock* getLegendID(S32 y); - F64 getTime(const std::string& name); protected: virtual void onClickCloseBtn(); 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