diff options
author | Richard Linden <none@none> | 2013-10-07 13:38:03 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-10-07 13:38:03 -0700 |
commit | 17df8988fec3f2ba991ca9e34ff8148253a2fc04 (patch) | |
tree | d06a8919e3ad5a56aa37c9706f05e33bf5b188f0 /indra/llcommon | |
parent | bee38adb347213bc1824dad8a762dc399c3065ec (diff) |
renamed TraceType to StatType
added more MemTrackable types
optimized memory usage of LLTrace some more
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 2 | ||||
-rwxr-xr-x | indra/llcommon/llfasttimer.h | 10 | ||||
-rw-r--r-- | indra/llcommon/lltrace.cpp | 4 | ||||
-rw-r--r-- | indra/llcommon/lltrace.h | 127 | ||||
-rw-r--r-- | indra/llcommon/lltraceaccumulators.cpp | 8 | ||||
-rw-r--r-- | indra/llcommon/lltraceaccumulators.h | 18 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 104 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 166 |
8 files changed, 233 insertions, 206 deletions
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 32ef01b2b6..c948e0ac85 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -165,7 +165,7 @@ U64 TimeBlock::countsPerSecond() #endif TimeBlock::TimeBlock(const char* name, TimeBlock* parent) -: TraceType<TimeBlockAccumulator>(name) +: StatType<TimeBlockAccumulator>(name) {} TimeBlockTreeNode& TimeBlock::getTreeNode() const diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 4eb12907dc..1266d87f08 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -86,7 +86,7 @@ LL_FORCE_INLINE class BlockTimer timeThisBlock(class TimeBlock& timer) // stores a "named" timer instance to be reused via multiple BlockTimer stack instances class TimeBlock -: public TraceType<TimeBlockAccumulator>, +: public StatType<TimeBlockAccumulator>, public LLInstanceTracker<TimeBlock> { public: @@ -102,14 +102,14 @@ public: child_iter endChildren(); std::vector<TimeBlock*>& getChildren(); - TraceType<TimeBlockAccumulator::CallCountFacet>& callCount() + StatType<TimeBlockAccumulator::CallCountFacet>& callCount() { - return static_cast<TraceType<TimeBlockAccumulator::CallCountFacet>&>(*(TraceType<TimeBlockAccumulator>*)this); + return static_cast<StatType<TimeBlockAccumulator::CallCountFacet>&>(*(StatType<TimeBlockAccumulator>*)this); } - TraceType<TimeBlockAccumulator::SelfTimeFacet>& selfTime() + StatType<TimeBlockAccumulator::SelfTimeFacet>& selfTime() { - return static_cast<TraceType<TimeBlockAccumulator::SelfTimeFacet>&>(*(TraceType<TimeBlockAccumulator>*)this); + return static_cast<StatType<TimeBlockAccumulator::SelfTimeFacet>&>(*(StatType<TimeBlockAccumulator>*)this); } static TimeBlock& getRootTimeBlock(); diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp index 73846ba900..1ad31cacfe 100644 --- a/indra/llcommon/lltrace.cpp +++ b/indra/llcommon/lltrace.cpp @@ -35,7 +35,7 @@ namespace LLTrace MemStatHandle gTraceMemStat("LLTrace"); -TraceBase::TraceBase( const char* name, const char* description ) +StatBase::StatBase( const char* name, const char* description ) : mName(name), mDescription(description ? description : "") { @@ -47,7 +47,7 @@ TraceBase::TraceBase( const char* name, const char* description ) #endif } -const char* TraceBase::getUnitLabel() const +const char* StatBase::getUnitLabel() const { return ""; } diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 3dc2e5248f..325112b9b1 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -38,8 +38,6 @@ #include "llpointer.h" #include "llunits.h" -#include <list> - namespace LLTrace { class Recording; @@ -53,11 +51,11 @@ STORAGE_TYPE storage_value(LLUnit<STORAGE_TYPE, UNIT_TYPE> val) { return val.val template<typename UNIT_TYPE, typename STORAGE_TYPE> STORAGE_TYPE storage_value(LLUnitImplicit<STORAGE_TYPE, UNIT_TYPE> val) { return val.value(); } -class TraceBase +class StatBase { public: - TraceBase(const char* name, const char* description); - virtual ~TraceBase() {}; + StatBase(const char* name, const char* description); + virtual ~StatBase() {}; virtual const char* getUnitLabel() const; const std::string& getName() const { return mName; } @@ -69,14 +67,14 @@ protected: }; template<typename ACCUMULATOR> -class TraceType -: public TraceBase, - public LLInstanceTracker<TraceType<ACCUMULATOR>, std::string> +class StatType +: public StatBase, + public LLInstanceTracker<StatType<ACCUMULATOR>, std::string> { public: - TraceType(const char* name, const char* description = NULL) - : LLInstanceTracker<TraceType<ACCUMULATOR>, std::string>(name), - TraceBase(name, description), + StatType(const char* name, const char* description = NULL) + : LLInstanceTracker<StatType<ACCUMULATOR>, std::string>(name), + StatBase(name, description), mAccumulatorIndex(AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer()->reserveSlot()) {} @@ -95,38 +93,38 @@ protected: template<> -class TraceType<TimeBlockAccumulator::CallCountFacet> -: public TraceType<TimeBlockAccumulator> +class StatType<TimeBlockAccumulator::CallCountFacet> +: public StatType<TimeBlockAccumulator> { public: - TraceType(const char* name, const char* description = "") - : TraceType<TimeBlockAccumulator>(name, description) + StatType(const char* name, const char* description = "") + : StatType<TimeBlockAccumulator>(name, description) {} }; template<> -class TraceType<TimeBlockAccumulator::SelfTimeFacet> - : public TraceType<TimeBlockAccumulator> +class StatType<TimeBlockAccumulator::SelfTimeFacet> + : public StatType<TimeBlockAccumulator> { public: - TraceType(const char* name, const char* description = "") - : TraceType<TimeBlockAccumulator>(name, description) + StatType(const char* name, const char* description = "") + : StatType<TimeBlockAccumulator>(name, description) {} }; template <typename T = F64> class EventStatHandle -: public TraceType<EventAccumulator> +: public StatType<EventAccumulator> { public: typedef F64 storage_t; - typedef TraceType<EventAccumulator> trace_t; + typedef StatType<EventAccumulator> stat_t; typedef EventStatHandle<T> self_t; EventStatHandle(const char* name, const char* description = NULL) - : trace_t(name, description) + : stat_t(name, description) {} /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } @@ -142,15 +140,15 @@ void record(EventStatHandle<T>& measurement, VALUE_T value) template <typename T = F64> class SampleStatHandle -: public TraceType<SampleAccumulator> +: public StatType<SampleAccumulator> { public: typedef F64 storage_t; - typedef TraceType<SampleAccumulator> trace_t; + typedef StatType<SampleAccumulator> stat_t; typedef SampleStatHandle<T> self_t; SampleStatHandle(const char* name, const char* description = NULL) - : trace_t(name, description) + : stat_t(name, description) {} /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } @@ -165,15 +163,15 @@ void sample(SampleStatHandle<T>& measurement, VALUE_T value) template <typename T = F64> class CountStatHandle -: public TraceType<CountAccumulator> +: public StatType<CountAccumulator> { public: typedef F64 storage_t; - typedef TraceType<CountAccumulator> trace_t; + typedef StatType<CountAccumulator> stat_t; typedef CountStatHandle<T> self_t; CountStatHandle(const char* name, const char* description = NULL) - : trace_t(name, description) + : stat_t(name, description) {} /*virtual*/ const char* getUnitLabel() const { return LLGetUnitLabel<T>::getUnitLabel(); } @@ -187,34 +185,36 @@ void add(CountStatHandle<T>& count, VALUE_T value) } template<> -class TraceType<MemStatAccumulator::AllocationFacet> -: public TraceType<MemStatAccumulator> +class StatType<MemAccumulator::AllocationFacet> +: public StatType<MemAccumulator> { public: - TraceType(const char* name, const char* description = "") - : TraceType<MemStatAccumulator>(name, description) + StatType(const char* name, const char* description = "") + : StatType<MemAccumulator>(name, description) {} }; template<> -class TraceType<MemStatAccumulator::DeallocationFacet> -: public TraceType<MemStatAccumulator> +class StatType<MemAccumulator::DeallocationFacet> +: public StatType<MemAccumulator> { public: - TraceType(const char* name, const char* description = "") - : TraceType<MemStatAccumulator>(name, description) + StatType(const char* name, const char* description = "") + : StatType<MemAccumulator>(name, description) {} }; -class MemStatHandle : public TraceType<MemStatAccumulator> +class MemStatHandle : public StatType<MemAccumulator> { public: - typedef TraceType<MemStatAccumulator> trace_t; + typedef StatType<MemAccumulator> stat_t; MemStatHandle(const char* name) - : trace_t(name) - {} + : stat_t(name) + { + mName = name; + } void setName(const char* name) { @@ -224,14 +224,14 @@ public: /*virtual*/ const char* getUnitLabel() const { return "KB"; } - TraceType<MemStatAccumulator::AllocationFacet>& allocations() + StatType<MemAccumulator::AllocationFacet>& allocations() { - return static_cast<TraceType<MemStatAccumulator::AllocationFacet>&>(*(TraceType<MemStatAccumulator>*)this); + return static_cast<StatType<MemAccumulator::AllocationFacet>&>(*(StatType<MemAccumulator>*)this); } - TraceType<MemStatAccumulator::DeallocationFacet>& deallocations() + StatType<MemAccumulator::DeallocationFacet>& deallocations() { - return static_cast<TraceType<MemStatAccumulator::DeallocationFacet>&>(*(TraceType<MemStatAccumulator>*)this); + return static_cast<StatType<MemAccumulator::DeallocationFacet>&>(*(StatType<MemAccumulator>*)this); } }; @@ -324,7 +324,7 @@ inline void claim_alloc(MemStatHandle& measurement, const T& value) { S32 size = MeasureMem<T>::measureFootprint(value); if(size == 0) return; - MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + MemAccumulator& accumulator = measurement.getCurrentAccumulator(); accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); accumulator.mAllocations.record(size); } @@ -334,18 +334,18 @@ inline void disclaim_alloc(MemStatHandle& measurement, const T& value) { S32 size = MeasureMem<T>::measureFootprint(value); if(size == 0) return; - MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + MemAccumulator& accumulator = measurement.getCurrentAccumulator(); accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size); accumulator.mDeallocations.add(size); } template<typename DERIVED, size_t ALIGNMENT = LL_DEFAULT_HEAP_ALIGN> -class MemTrackable +class MemTrackableNonVirtual { public: typedef void mem_trackable_tag_t; - MemTrackable(const char* name) + MemTrackableNonVirtual(const char* name) : mMemFootprint(0) { static bool name_initialized = false; @@ -356,7 +356,7 @@ public: } } - virtual ~MemTrackable() + ~MemTrackableNonVirtual() { disclaimMem(mMemFootprint); } @@ -374,12 +374,27 @@ public: return ll_aligned_malloc(ALIGNMENT, size); } + template<int CUSTOM_ALIGNMENT> + static void* aligned_new(size_t size) + { + claim_alloc(sMemStat, size); + return ll_aligned_malloc(CUSTOM_ALIGNMENT, size); + } + void operator delete(void* ptr, size_t size) { disclaim_alloc(sMemStat, size); ll_aligned_free(ALIGNMENT, ptr); } + template<int CUSTOM_ALIGNMENT> + static void aligned_delete(void* ptr, size_t size) + { + disclaim_alloc(sMemStat, size); + ll_aligned_free(CUSTOM_ALIGNMENT, ptr); + } + + void* operator new [](size_t size) { claim_alloc(sMemStat, size); @@ -420,7 +435,19 @@ private: }; template<typename DERIVED, size_t ALIGNMENT> -MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(""); +MemStatHandle MemTrackableNonVirtual<DERIVED, ALIGNMENT>::sMemStat(typeid(MemTrackableNonVirtual<DERIVED, ALIGNMENT>).name()); +template<typename DERIVED, size_t ALIGNMENT = LL_DEFAULT_HEAP_ALIGN> +class MemTrackable : public MemTrackableNonVirtual<DERIVED, ALIGNMENT> +{ +public: + MemTrackable(const char* name) + : MemTrackableNonVirtual<DERIVED, ALIGNMENT>(name) + {} + + virtual ~MemTrackable() + {} +}; } + #endif // LL_LLTRACE_H diff --git a/indra/llcommon/lltraceaccumulators.cpp b/indra/llcommon/lltraceaccumulators.cpp index c25bb704f5..7d0e63e76a 100644 --- a/indra/llcommon/lltraceaccumulators.cpp +++ b/indra/llcommon/lltraceaccumulators.cpp @@ -45,7 +45,7 @@ AccumulatorBufferGroup::AccumulatorBufferGroup() claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator)); claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator)); claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator)); - claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator)); + claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator)); } AccumulatorBufferGroup::AccumulatorBufferGroup(const AccumulatorBufferGroup& other) @@ -59,7 +59,7 @@ AccumulatorBufferGroup::AccumulatorBufferGroup(const AccumulatorBufferGroup& oth claim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator)); claim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator)); claim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator)); - claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator)); + claim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator)); } AccumulatorBufferGroup::~AccumulatorBufferGroup() @@ -68,7 +68,7 @@ AccumulatorBufferGroup::~AccumulatorBufferGroup() disclaim_alloc(gTraceMemStat, mSamples.capacity() * sizeof(SampleAccumulator)); disclaim_alloc(gTraceMemStat, mEvents.capacity() * sizeof(EventAccumulator)); disclaim_alloc(gTraceMemStat, mStackTimers.capacity() * sizeof(TimeBlockAccumulator)); - disclaim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemStatAccumulator)); + disclaim_alloc(gTraceMemStat, mMemStats.capacity() * sizeof(MemAccumulator)); } void AccumulatorBufferGroup::handOffTo(AccumulatorBufferGroup& other) @@ -108,7 +108,7 @@ void AccumulatorBufferGroup::clearCurrent() AccumulatorBuffer<SampleAccumulator>::clearCurrent(); AccumulatorBuffer<EventAccumulator>::clearCurrent(); AccumulatorBuffer<TimeBlockAccumulator>::clearCurrent(); - AccumulatorBuffer<MemStatAccumulator>::clearCurrent(); + AccumulatorBuffer<MemAccumulator>::clearCurrent(); } bool AccumulatorBufferGroup::isCurrent() const diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 27c0910665..85873d469a 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -52,7 +52,7 @@ namespace LLTrace class AccumulatorBuffer : public LLRefCount { typedef AccumulatorBuffer<ACCUMULATOR> self_t; - static const S32 ACCUMULATOR_BUFFER_SIZE_INCREMENT = 16; + static const S32 DEFAULT_ACCUMULATOR_BUFFER_SIZE = 32; private: struct StaticAllocationMarker { }; @@ -67,7 +67,7 @@ namespace LLTrace : mStorageSize(0), mStorage(NULL) { - resize(other.mStorageSize); + resize(sNextStorageSlot); for (S32 i = 0; i < sNextStorageSlot; i++) { mStorage[i] = other.mStorage[i]; @@ -152,7 +152,7 @@ namespace LLTrace { // don't perform doubling, as this should only happen during startup // want to keep a tight bounds as we will have a lot of these buffers - resize(mStorageSize + ACCUMULATOR_BUFFER_SIZE_INCREMENT); + resize(mStorageSize + mStorageSize / 2); } llassert(mStorage && next_slot < mStorageSize); return next_slot; @@ -207,7 +207,7 @@ namespace LLTrace // so as not to trigger an access violation sDefaultBuffer = new AccumulatorBuffer(StaticAllocationMarker()); sInitialized = true; - sDefaultBuffer->resize(ACCUMULATOR_BUFFER_SIZE_INCREMENT); + sDefaultBuffer->resize(DEFAULT_ACCUMULATOR_BUFFER_SIZE); } return sDefaultBuffer; } @@ -491,9 +491,9 @@ namespace LLTrace U64 mChildTime; }; - struct MemStatAccumulator + struct MemAccumulator { - typedef MemStatAccumulator self_t; + typedef MemAccumulator self_t; // fake classes that allows us to view different facets of underlying statistic struct AllocationFacet @@ -506,7 +506,7 @@ namespace LLTrace typedef F64Bytes value_t; }; - void addSamples(const MemStatAccumulator& other, EBufferAppendType append_type) + void addSamples(const MemAccumulator& other, EBufferAppendType append_type) { mAllocations.addSamples(other.mAllocations, append_type); mDeallocations.addSamples(other.mDeallocations, append_type); @@ -524,7 +524,7 @@ namespace LLTrace } } - void reset(const MemStatAccumulator* other) + void reset(const MemAccumulator* other) { mSize.reset(other ? &other->mSize : NULL); mAllocations.reset(other ? &other->mAllocations : NULL); @@ -561,7 +561,7 @@ namespace LLTrace AccumulatorBuffer<SampleAccumulator> mSamples; AccumulatorBuffer<EventAccumulator> mEvents; AccumulatorBuffer<TimeBlockAccumulator> mStackTimers; - AccumulatorBuffer<MemStatAccumulator> mMemStats; + AccumulatorBuffer<MemAccumulator> mMemStats; }; } diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 06b4351339..87083eee96 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -137,26 +137,26 @@ void Recording::appendRecording( Recording& other ) mElapsedSeconds += other.mElapsedSeconds; } -F64Seconds Recording::getSum(const TraceType<TimeBlockAccumulator>& stat) +F64Seconds Recording::getSum(const StatType<TimeBlockAccumulator>& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; return F64Seconds((F64)(accumulator.mTotalTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); } -F64Seconds Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat) +F64Seconds Recording::getSum(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; return F64Seconds((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); } -S32 Recording::getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat) +S32 Recording::getSum(const StatType<TimeBlockAccumulator::CallCountFacet>& stat) { return mBuffers->mStackTimers[stat.getIndex()].mCalls; } -F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator>& stat) +F64Seconds Recording::getPerSec(const StatType<TimeBlockAccumulator>& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; @@ -164,7 +164,7 @@ F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator>& stat) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } -F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat) +F64Seconds Recording::getPerSec(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; @@ -172,158 +172,158 @@ F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFa / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value())); } -F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat) +F32 Recording::getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& stat) { return (F32)mBuffers->mStackTimers[stat.getIndex()].mCalls / mElapsedSeconds.value(); } -bool Recording::hasValue(const TraceType<MemStatAccumulator>& stat) +bool Recording::hasValue(const StatType<MemAccumulator>& stat) { return mBuffers->mMemStats[stat.getIndex()].mSize.hasValue(); } -F64Kilobytes Recording::getMin(const TraceType<MemStatAccumulator>& stat) +F64Kilobytes Recording::getMin(const StatType<MemAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); } -F64Kilobytes Recording::getMean(const TraceType<MemStatAccumulator>& stat) +F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMean()); } -F64Kilobytes Recording::getMax(const TraceType<MemStatAccumulator>& stat) +F64Kilobytes Recording::getMax(const StatType<MemAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMax()); } -F64Kilobytes Recording::getStandardDeviation(const TraceType<MemStatAccumulator>& stat) +F64Kilobytes Recording::getStandardDeviation(const StatType<MemAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation()); } -F64Kilobytes Recording::getLastValue(const TraceType<MemStatAccumulator>& stat) +F64Kilobytes Recording::getLastValue(const StatType<MemAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); } -F64Kilobytes Recording::getSum(const TraceType<MemStatAccumulator::AllocationFacet>& stat) +F64Kilobytes Recording::getSum(const StatType<MemAccumulator::AllocationFacet>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocations.getSum()); } -F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::AllocationFacet>& stat) +F64Kilobytes Recording::getPerSec(const StatType<MemAccumulator::AllocationFacet>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocations.getSum() / mElapsedSeconds.value()); } -S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat) +S32 Recording::getSampleCount(const StatType<MemAccumulator::AllocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mAllocations.getSampleCount(); } -F64Kilobytes Recording::getSum(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) +F64Kilobytes Recording::getSum(const StatType<MemAccumulator::DeallocationFacet>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSum()); } -F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) +F64Kilobytes Recording::getPerSec(const StatType<MemAccumulator::DeallocationFacet>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSum() / mElapsedSeconds.value()); } -S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) +S32 Recording::getSampleCount(const StatType<MemAccumulator::DeallocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSampleCount(); } -F64 Recording::getSum( const TraceType<CountAccumulator>& stat ) +F64 Recording::getSum( const StatType<CountAccumulator>& stat ) { return mBuffers->mCounts[stat.getIndex()].getSum(); } -F64 Recording::getSum( const TraceType<EventAccumulator>& stat ) +F64 Recording::getSum( const StatType<EventAccumulator>& stat ) { return (F64)mBuffers->mEvents[stat.getIndex()].getSum(); } -F64 Recording::getPerSec( const TraceType<CountAccumulator>& stat ) +F64 Recording::getPerSec( const StatType<CountAccumulator>& stat ) { F64 sum = mBuffers->mCounts[stat.getIndex()].getSum(); return sum / mElapsedSeconds.value(); } -S32 Recording::getSampleCount( const TraceType<CountAccumulator>& stat ) +S32 Recording::getSampleCount( const StatType<CountAccumulator>& stat ) { return mBuffers->mCounts[stat.getIndex()].getSampleCount(); } -bool Recording::hasValue(const TraceType<SampleAccumulator>& stat) +bool Recording::hasValue(const StatType<SampleAccumulator>& stat) { return mBuffers->mSamples[stat.getIndex()].hasValue(); } -F64 Recording::getMin( const TraceType<SampleAccumulator>& stat ) +F64 Recording::getMin( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getMin(); } -F64 Recording::getMax( const TraceType<SampleAccumulator>& stat ) +F64 Recording::getMax( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getMax(); } -F64 Recording::getMean( const TraceType<SampleAccumulator>& stat ) +F64 Recording::getMean( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getMean(); } -F64 Recording::getStandardDeviation( const TraceType<SampleAccumulator>& stat ) +F64 Recording::getStandardDeviation( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getStandardDeviation(); } -F64 Recording::getLastValue( const TraceType<SampleAccumulator>& stat ) +F64 Recording::getLastValue( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getLastValue(); } -S32 Recording::getSampleCount( const TraceType<SampleAccumulator>& stat ) +S32 Recording::getSampleCount( const StatType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getSampleCount(); } -bool Recording::hasValue(const TraceType<EventAccumulator>& stat) +bool Recording::hasValue(const StatType<EventAccumulator>& stat) { return mBuffers->mEvents[stat.getIndex()].hasValue(); } -F64 Recording::getMin( const TraceType<EventAccumulator>& stat ) +F64 Recording::getMin( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getMin(); } -F64 Recording::getMax( const TraceType<EventAccumulator>& stat ) +F64 Recording::getMax( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getMax(); } -F64 Recording::getMean( const TraceType<EventAccumulator>& stat ) +F64 Recording::getMean( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getMean(); } -F64 Recording::getStandardDeviation( const TraceType<EventAccumulator>& stat ) +F64 Recording::getStandardDeviation( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getStandardDeviation(); } -F64 Recording::getLastValue( const TraceType<EventAccumulator>& stat ) +F64 Recording::getLastValue( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getLastValue(); } -S32 Recording::getSampleCount( const TraceType<EventAccumulator>& stat ) +S32 Recording::getSampleCount( const StatType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getSampleCount(); } @@ -534,7 +534,7 @@ void PeriodicRecording::handleSplitTo(PeriodicRecording& other) getCurRecording().splitTo(other.getCurRecording()); } -F64 PeriodicRecording::getPeriodMin( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodMin( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -556,7 +556,7 @@ F64 PeriodicRecording::getPeriodMin( const TraceType<EventAccumulator>& stat, S3 : NaN; } -F64 PeriodicRecording::getPeriodMax( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodMax( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -579,7 +579,7 @@ F64 PeriodicRecording::getPeriodMax( const TraceType<EventAccumulator>& stat, S3 } // calculates means using aggregates per period -F64 PeriodicRecording::getPeriodMean( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodMean( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -603,7 +603,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<EventAccumulator>& stat, S } -F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodStandardDeviation( const StatType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -628,7 +628,7 @@ F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<EventAccumula : NaN; } -F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodMin( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -650,7 +650,7 @@ F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, S : NaN; } -F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/) +F64 PeriodicRecording::getPeriodMax(const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -673,7 +673,7 @@ F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, S3 } -F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodMean( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -696,7 +696,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat, : NaN; } -F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64 PeriodicRecording::getPeriodStandardDeviation( const StatType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -722,7 +722,7 @@ F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumul } -F64Kilobytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodMin( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -739,10 +739,10 @@ F64Kilobytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator F64Kilobytes PeriodicRecording::getPeriodMin(const MemStatHandle& stat, S32 num_periods) { - return getPeriodMin(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); + return getPeriodMin(static_cast<const StatType<MemAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/) +F64Kilobytes PeriodicRecording::getPeriodMax(const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -759,10 +759,10 @@ F64Kilobytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator> F64Kilobytes PeriodicRecording::getPeriodMax(const MemStatHandle& stat, S32 num_periods) { - return getPeriodMax(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); + return getPeriodMax(static_cast<const StatType<MemAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodMean( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -780,10 +780,10 @@ F64Kilobytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulato F64Kilobytes PeriodicRecording::getPeriodMean(const MemStatHandle& stat, S32 num_periods) { - return getPeriodMean(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); + return getPeriodMean(static_cast<const StatType<MemAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const StatType<MemAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -810,7 +810,7 @@ F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemS F64Kilobytes PeriodicRecording::getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods) { - return getPeriodStandardDeviation(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); + return getPeriodStandardDeviation(static_cast<const StatType<MemAccumulator>&>(stat), num_periods); } /////////////////////////////////////////////////////////////////////// diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 8bb0b1892f..810f796666 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -113,7 +113,7 @@ private: namespace LLTrace { template<typename T> - class TraceType; + class StatType; template<typename T> class CountStatHandle; @@ -168,135 +168,135 @@ namespace LLTrace void makeUnique() { mBuffers.makeUnique(); } // Timer accessors - F64Seconds getSum(const TraceType<TimeBlockAccumulator>& stat); - F64Seconds getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); - S32 getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); + F64Seconds getSum(const StatType<TimeBlockAccumulator>& stat); + F64Seconds getSum(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat); + S32 getSum(const StatType<TimeBlockAccumulator::CallCountFacet>& stat); - F64Seconds getPerSec(const TraceType<TimeBlockAccumulator>& stat); - F64Seconds getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); - F32 getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); + F64Seconds getPerSec(const StatType<TimeBlockAccumulator>& stat); + F64Seconds getPerSec(const StatType<TimeBlockAccumulator::SelfTimeFacet>& stat); + F32 getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& stat); // Memory accessors - bool hasValue(const TraceType<MemStatAccumulator>& stat); + bool hasValue(const StatType<MemAccumulator>& stat); - F64Kilobytes getMin(const TraceType<MemStatAccumulator>& stat); - F64Kilobytes getMean(const TraceType<MemStatAccumulator>& stat); - F64Kilobytes getMax(const TraceType<MemStatAccumulator>& stat); - F64Kilobytes getStandardDeviation(const TraceType<MemStatAccumulator>& stat); - F64Kilobytes getLastValue(const TraceType<MemStatAccumulator>& stat); + F64Kilobytes getMin(const StatType<MemAccumulator>& stat); + F64Kilobytes getMean(const StatType<MemAccumulator>& stat); + F64Kilobytes getMax(const StatType<MemAccumulator>& stat); + F64Kilobytes getStandardDeviation(const StatType<MemAccumulator>& stat); + F64Kilobytes getLastValue(const StatType<MemAccumulator>& stat); - F64Kilobytes getSum(const TraceType<MemStatAccumulator::AllocationFacet>& stat); - F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::AllocationFacet>& stat); - S32 getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat); + F64Kilobytes getSum(const StatType<MemAccumulator::AllocationFacet>& stat); + F64Kilobytes getPerSec(const StatType<MemAccumulator::AllocationFacet>& stat); + S32 getSampleCount(const StatType<MemAccumulator::AllocationFacet>& stat); - F64Kilobytes getSum(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); - F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); - S32 getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); + F64Kilobytes getSum(const StatType<MemAccumulator::DeallocationFacet>& stat); + F64Kilobytes getPerSec(const StatType<MemAccumulator::DeallocationFacet>& stat); + S32 getSampleCount(const StatType<MemAccumulator::DeallocationFacet>& stat); // CountStatHandle accessors - F64 getSum(const TraceType<CountAccumulator>& stat); + F64 getSum(const StatType<CountAccumulator>& stat); template <typename T> typename RelatedTypes<T>::sum_t getSum(const CountStatHandle<T>& stat) { - return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const TraceType<CountAccumulator>&> (stat)); + return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const StatType<CountAccumulator>&> (stat)); } - F64 getPerSec(const TraceType<CountAccumulator>& stat); + F64 getPerSec(const StatType<CountAccumulator>& stat); template <typename T> typename RelatedTypes<T>::fractional_t getPerSec(const CountStatHandle<T>& stat) { - return (typename RelatedTypes<T>::fractional_t)getPerSec(static_cast<const TraceType<CountAccumulator>&> (stat)); + return (typename RelatedTypes<T>::fractional_t)getPerSec(static_cast<const StatType<CountAccumulator>&> (stat)); } - S32 getSampleCount(const TraceType<CountAccumulator>& stat); + S32 getSampleCount(const StatType<CountAccumulator>& stat); // SampleStatHandle accessors - bool hasValue(const TraceType<SampleAccumulator>& stat); + bool hasValue(const StatType<SampleAccumulator>& stat); - F64 getMin(const TraceType<SampleAccumulator>& stat); + F64 getMin(const StatType<SampleAccumulator>& stat); template <typename T> T getMin(const SampleStatHandle<T>& stat) { - return (T)getMin(static_cast<const TraceType<SampleAccumulator>&> (stat)); + return (T)getMin(static_cast<const StatType<SampleAccumulator>&> (stat)); } - F64 getMax(const TraceType<SampleAccumulator>& stat); + F64 getMax(const StatType<SampleAccumulator>& stat); template <typename T> T getMax(const SampleStatHandle<T>& stat) { - return (T)getMax(static_cast<const TraceType<SampleAccumulator>&> (stat)); + return (T)getMax(static_cast<const StatType<SampleAccumulator>&> (stat)); } - F64 getMean(const TraceType<SampleAccumulator>& stat); + F64 getMean(const StatType<SampleAccumulator>& stat); template <typename T> typename RelatedTypes<T>::fractional_t getMean(SampleStatHandle<T>& stat) { - return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const TraceType<SampleAccumulator>&> (stat)); + return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const StatType<SampleAccumulator>&> (stat)); } - F64 getStandardDeviation(const TraceType<SampleAccumulator>& stat); + F64 getStandardDeviation(const StatType<SampleAccumulator>& stat); template <typename T> typename RelatedTypes<T>::fractional_t getStandardDeviation(const SampleStatHandle<T>& stat) { - return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const TraceType<SampleAccumulator>&> (stat)); + return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const StatType<SampleAccumulator>&> (stat)); } - F64 getLastValue(const TraceType<SampleAccumulator>& stat); + F64 getLastValue(const StatType<SampleAccumulator>& stat); template <typename T> T getLastValue(const SampleStatHandle<T>& stat) { - return (T)getLastValue(static_cast<const TraceType<SampleAccumulator>&> (stat)); + return (T)getLastValue(static_cast<const StatType<SampleAccumulator>&> (stat)); } - S32 getSampleCount(const TraceType<SampleAccumulator>& stat); + S32 getSampleCount(const StatType<SampleAccumulator>& stat); // EventStatHandle accessors - bool hasValue(const TraceType<EventAccumulator>& stat); + bool hasValue(const StatType<EventAccumulator>& stat); - F64 getSum(const TraceType<EventAccumulator>& stat); + F64 getSum(const StatType<EventAccumulator>& stat); template <typename T> typename RelatedTypes<T>::sum_t getSum(const EventStatHandle<T>& stat) { - return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (typename RelatedTypes<T>::sum_t)getSum(static_cast<const StatType<EventAccumulator>&> (stat)); } - F64 getMin(const TraceType<EventAccumulator>& stat); + F64 getMin(const StatType<EventAccumulator>& stat); template <typename T> T getMin(const EventStatHandle<T>& stat) { - return (T)getMin(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (T)getMin(static_cast<const StatType<EventAccumulator>&> (stat)); } - F64 getMax(const TraceType<EventAccumulator>& stat); + F64 getMax(const StatType<EventAccumulator>& stat); template <typename T> T getMax(const EventStatHandle<T>& stat) { - return (T)getMax(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (T)getMax(static_cast<const StatType<EventAccumulator>&> (stat)); } - F64 getMean(const TraceType<EventAccumulator>& stat); + F64 getMean(const StatType<EventAccumulator>& stat); template <typename T> typename RelatedTypes<T>::fractional_t getMean(EventStatHandle<T>& stat) { - return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (typename RelatedTypes<T>::fractional_t)getMean(static_cast<const StatType<EventAccumulator>&> (stat)); } - F64 getStandardDeviation(const TraceType<EventAccumulator>& stat); + F64 getStandardDeviation(const StatType<EventAccumulator>& stat); template <typename T> typename RelatedTypes<T>::fractional_t getStandardDeviation(const EventStatHandle<T>& stat) { - return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (typename RelatedTypes<T>::fractional_t)getStandardDeviation(static_cast<const StatType<EventAccumulator>&> (stat)); } - F64 getLastValue(const TraceType<EventAccumulator>& stat); + F64 getLastValue(const StatType<EventAccumulator>& stat); template <typename T> T getLastValue(const EventStatHandle<T>& stat) { - return (T)getLastValue(static_cast<const TraceType<EventAccumulator>&> (stat)); + return (T)getLastValue(static_cast<const StatType<EventAccumulator>&> (stat)); } - S32 getSampleCount(const TraceType<EventAccumulator>& stat); + S32 getSampleCount(const StatType<EventAccumulator>& stat); F64Seconds getDuration() const { return mElapsedSeconds; } @@ -342,7 +342,7 @@ namespace LLTrace Recording snapshotCurRecording() const; template <typename T> - S32 getSampleCount(const TraceType<T>& stat, S32 num_periods = S32_MAX) + S32 getSampleCount(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -362,7 +362,7 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename T::value_t getPeriodMin(const TraceType<T>& stat, S32 num_periods = S32_MAX) + typename T::value_t getPeriodMin(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -379,28 +379,28 @@ namespace LLTrace template<typename T> T getPeriodMin(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return T(getPeriodMin(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMin(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> T getPeriodMin(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); + return T(getPeriodMin(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMin(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> T getPeriodMin(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); + return T(getPeriodMin(static_cast<const StatType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMin(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMin(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMin(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -417,7 +417,7 @@ namespace LLTrace template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMinPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMinPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMinPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } // @@ -426,7 +426,7 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename T::value_t getPeriodMax(const TraceType<T>& stat, S32 num_periods = S32_MAX) + typename T::value_t getPeriodMax(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -443,28 +443,28 @@ namespace LLTrace template<typename T> T getPeriodMax(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return T(getPeriodMax(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMax(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> T getPeriodMax(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); + return T(getPeriodMax(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMax(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> T getPeriodMax(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); + return T(getPeriodMax(static_cast<const StatType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMax(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMax(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMax(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -481,7 +481,7 @@ namespace LLTrace template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMaxPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMaxPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMaxPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } // @@ -490,7 +490,7 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMean(const TraceType<T >& stat, S32 num_periods = S32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMean(const StatType<T >& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -513,27 +513,27 @@ namespace LLTrace template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMean(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMean(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMean(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodMean(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMean(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const StatType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMean(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMean(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMean(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const StatType<T>& stat, S32 num_periods = S32_MAX) { S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); @@ -557,29 +557,29 @@ namespace LLTrace template<typename T> typename RelatedTypes<T>::fractional_t getPeriodMeanPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodMeanPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodMeanPerSec(static_cast<const StatType<CountAccumulator>&>(stat), num_periods)); } // // PERIODIC STANDARD DEVIATION // - F64 getPeriodStandardDeviation(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodStandardDeviation(const StatType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const StatType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodStandardDeviation(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); + F64 getPeriodStandardDeviation(const StatType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); + return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const StatType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodStandardDeviation(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodStandardDeviation(const StatType<MemAccumulator>& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods = S32_MAX); private: |