diff options
Diffstat (limited to 'indra/llcommon/lltrace.h')
-rw-r--r-- | indra/llcommon/lltrace.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index a6b1b227c9..6e6bb51e47 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -201,18 +201,27 @@ namespace LLTrace } private: - ACCUMULATOR* mStorage; - size_t mStorageSize; - size_t mNextStorageSlot; + ACCUMULATOR* mStorage; + size_t mStorageSize; + size_t mNextStorageSlot; static LLThreadLocalPointer<ACCUMULATOR> sPrimaryStorage; }; template<typename ACCUMULATOR> LLThreadLocalPointer<ACCUMULATOR> AccumulatorBuffer<ACCUMULATOR>::sPrimaryStorage; + //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> { public: + typedef typename MeanValueType<TraceType<ACCUMULATOR> >::type mean_t; + TraceType(const char* name, const char* description = NULL) : LLInstanceTracker(name), mName(name), @@ -415,6 +424,13 @@ namespace LLTrace U32 mCalls; }; + + template<> + struct MeanValueType<TraceType<TimeBlockAccumulator> > + { + typedef LLUnit<LLUnits::Seconds, F64> type; + }; + template<> class TraceType<TimeBlockAccumulator::CallCountAspect> : public TraceType<TimeBlockAccumulator> |