From 49933aadb1b7044e947575bc377b34826e94fe99 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 11 Apr 2013 06:38:03 -0700 Subject: [PATCH] SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed MeanValueType<T> --- indra/llcommon/lltrace.h | 31 +-------------------------- indra/llcommon/lltracerecording.h | 8 +++---- indra/newview/llviewertexturelist.cpp | 2 +- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index a574be02da0..376248c87a6 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -231,15 +231,6 @@ class AccumulatorBuffer : public LLRefCount template<typename ACCUMULATOR> size_t AccumulatorBuffer<ACCUMULATOR>::sNextStorageSlot = 0; - - -//TODO: replace with decltype when C++11 is enabled -template<typename T> -struct MeanValueType -{ - typedef F64 type; -}; - template<typename ACCUMULATOR> class TraceType : public LLInstanceTracker<TraceType<ACCUMULATOR>, std::string> @@ -382,6 +373,7 @@ class MeasurementAccumulator U32 mNumSamples; }; + template<typename T> class CountAccumulator { @@ -457,13 +449,6 @@ class TimeBlockAccumulator }; - -template<> -struct MeanValueType<TraceType<TimeBlockAccumulator> > -{ - typedef LLUnit<LLUnits::Seconds, F64> type; -}; - template<> class TraceType<TimeBlockAccumulator::CallCountAspect> : public TraceType<TimeBlockAccumulator> @@ -475,13 +460,6 @@ class TraceType<TimeBlockAccumulator::CallCountAspect> {} }; -template<> -struct MeanValueType<TraceType<TimeBlockAccumulator::CallCountAspect> > -{ - typedef F64 type; -}; - - template<> class TraceType<TimeBlockAccumulator::SelfTimeAspect> : public TraceType<TimeBlockAccumulator> @@ -493,13 +471,6 @@ class TraceType<TimeBlockAccumulator::SelfTimeAspect> {} }; -template<> -struct MeanValueType<TraceType<TimeBlockAccumulator::SelfTimeAspect> > -{ - typedef LLUnit<LLUnits::Seconds, F64> type; -}; - - class TimeBlock; class TimeBlockTreeNode { diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 0a3e9e5a0b6..9ebcbdd8cea 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -345,9 +345,9 @@ namespace LLTrace } template <typename T> - typename MeanValueType<TraceType<T> >::type getPeriodMean(const TraceType<T>& stat) const + typename T::value_t getPeriodMean(const TraceType<T>& stat) const { - typename MeanValueType<TraceType<T> >::type mean = 0.0; + typename T::value_t mean = 0.0; U32 num_periods = mRecordingPeriods.size(); for (S32 i = 0; i < num_periods; i++) { @@ -361,9 +361,9 @@ namespace LLTrace } template <typename T> - typename MeanValueType<TraceType<T> >::type getPeriodMeanPerSec(const TraceType<T>& stat) const + typename T::value_t getPeriodMeanPerSec(const TraceType<T>& stat) const { - typename MeanValueType<TraceType<T> >::type mean = 0.0; + typename T::value_t mean = 0.0; U32 num_periods = mRecordingPeriods.size(); for (S32 i = 0; i < num_periods; i++) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 1bb4041bbdc..ae677f541bb 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -617,7 +617,7 @@ void LLViewerTextureList::updateImages(F32 max_time) } cleared = FALSE; - LLAppViewer::getTextureFetch()->setTextureBandwidth(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_KBIT).value()); + LLAppViewer::getTextureFetch()->setTextureBandwidth(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_KBIT)); { using namespace LLStatViewer; -- GitLab