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/llui/llstatbar.cpp | 7 +++---- indra/llui/llstatbar.h | 35 ++++++++++++++++++++--------------- indra/llui/llstatgraph.cpp | 6 +++--- 3 files changed, 26 insertions(+), 22 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 4cbf695059..b73007e107 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -37,7 +37,6 @@ #include "llstat.h" #include "lluictrlfactory.h" #include "lltracerecording.h" -#include "lltracethreadrecorder.h" /////////////////////////////////////////////////////////////////////////////////// @@ -112,17 +111,17 @@ void LLStatBar::draw() } else if (mFloatStatp) { - LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - current = recording->getSum(*mFloatStatp) / recording->getSampleTime(); + current = recording.getPerSec(*mFloatStatp); //min = recording->getMin(*mFloatStatp) / recording->getSampleTime(); //max = recording->getMax(*mFloatStatp) / recording->getSampleTime(); //mean = recording->getMean(*mFloatStatp) / recording->getSampleTime(); } else { - current = recording->getSum(*mFloatStatp); + current = recording.getSum(*mFloatStatp); //min = recording->getMin(*mFloatStatp); //max = recording->getMax(*mFloatStatp); //mean = recording->getMean(*mFloatStatp); diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index c735e7045b..bfc49b9204 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -29,8 +29,7 @@ #include "llview.h" #include "llframetimer.h" -#include "lltrace.h" - +#include "lltracerecording.h" class LLStat; class LLStatBar : public LLView @@ -39,19 +38,24 @@ public: struct Params : public LLInitParam::Block { - Optional label; - Optional unit_label; - Optional bar_min; - Optional bar_max; - Optional tick_spacing; - Optional label_spacing; - Optional precision; - Optional update_rate; - Optional show_per_sec; - Optional show_bar; - Optional show_history; - Optional show_mean; - Optional stat; + Optional label, + unit_label; + + Optional bar_min, + bar_max, + tick_spacing, + label_spacing, + update_rate; + + Optional precision; + + Optional show_per_sec, + show_bar, + show_history, + show_mean; + + Optional stat; + Params() : label("label"), unit_label("unit_label"), @@ -92,6 +96,7 @@ private: BOOL mDisplayBar; // Display the bar graph. BOOL mDisplayHistory; BOOL mDisplayMean; // If true, display mean, if false, display current value + LLTrace::PeriodicRecording* mFrameRecording; LLStat* mStatp; LLTrace::Rate* mFloatStatp; diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index 1d4527aaa3..21b55c7c5a 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -86,15 +86,15 @@ void LLStatGraph::draw() } else if (mF32Statp) { - LLTrace::Recording* recording = LLTrace::get_thread_recorder()->getPrimaryRecording(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); if (mPerSec) { - mValue = recording->getSum(*mF32Statp) / recording->getSampleTime(); + mValue = recording.getPerSec(*mF32Statp); } else { - mValue = recording->getSum(*mF32Statp); + mValue = recording.getSum(*mF32Statp); } } -- cgit v1.2.3