From 17df8988fec3f2ba991ca9e34ff8148253a2fc04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 7 Oct 2013 13:38:03 -0700 Subject: renamed TraceType to StatType added more MemTrackable types optimized memory usage of LLTrace some more --- indra/llcommon/lltracerecording.h | 166 +++++++++++++++++++------------------- 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'indra/llcommon/lltracerecording.h') 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 - class TraceType; + class StatType; template class CountStatHandle; @@ -168,135 +168,135 @@ namespace LLTrace void makeUnique() { mBuffers.makeUnique(); } // Timer accessors - F64Seconds getSum(const TraceType& stat); - F64Seconds getSum(const TraceType& stat); - S32 getSum(const TraceType& stat); + F64Seconds getSum(const StatType& stat); + F64Seconds getSum(const StatType& stat); + S32 getSum(const StatType& stat); - F64Seconds getPerSec(const TraceType& stat); - F64Seconds getPerSec(const TraceType& stat); - F32 getPerSec(const TraceType& stat); + F64Seconds getPerSec(const StatType& stat); + F64Seconds getPerSec(const StatType& stat); + F32 getPerSec(const StatType& stat); // Memory accessors - bool hasValue(const TraceType& stat); + bool hasValue(const StatType& stat); - F64Kilobytes getMin(const TraceType& stat); - F64Kilobytes getMean(const TraceType& stat); - F64Kilobytes getMax(const TraceType& stat); - F64Kilobytes getStandardDeviation(const TraceType& stat); - F64Kilobytes getLastValue(const TraceType& stat); + F64Kilobytes getMin(const StatType& stat); + F64Kilobytes getMean(const StatType& stat); + F64Kilobytes getMax(const StatType& stat); + F64Kilobytes getStandardDeviation(const StatType& stat); + F64Kilobytes getLastValue(const StatType& stat); - F64Kilobytes getSum(const TraceType& stat); - F64Kilobytes getPerSec(const TraceType& stat); - S32 getSampleCount(const TraceType& stat); + F64Kilobytes getSum(const StatType& stat); + F64Kilobytes getPerSec(const StatType& stat); + S32 getSampleCount(const StatType& stat); - F64Kilobytes getSum(const TraceType& stat); - F64Kilobytes getPerSec(const TraceType& stat); - S32 getSampleCount(const TraceType& stat); + F64Kilobytes getSum(const StatType& stat); + F64Kilobytes getPerSec(const StatType& stat); + S32 getSampleCount(const StatType& stat); // CountStatHandle accessors - F64 getSum(const TraceType& stat); + F64 getSum(const StatType& stat); template typename RelatedTypes::sum_t getSum(const CountStatHandle& stat) { - return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); + return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); } - F64 getPerSec(const TraceType& stat); + F64 getPerSec(const StatType& stat); template typename RelatedTypes::fractional_t getPerSec(const CountStatHandle& stat) { - return (typename RelatedTypes::fractional_t)getPerSec(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getPerSec(static_cast&> (stat)); } - S32 getSampleCount(const TraceType& stat); + S32 getSampleCount(const StatType& stat); // SampleStatHandle accessors - bool hasValue(const TraceType& stat); + bool hasValue(const StatType& stat); - F64 getMin(const TraceType& stat); + F64 getMin(const StatType& stat); template T getMin(const SampleStatHandle& stat) { - return (T)getMin(static_cast&> (stat)); + return (T)getMin(static_cast&> (stat)); } - F64 getMax(const TraceType& stat); + F64 getMax(const StatType& stat); template T getMax(const SampleStatHandle& stat) { - return (T)getMax(static_cast&> (stat)); + return (T)getMax(static_cast&> (stat)); } - F64 getMean(const TraceType& stat); + F64 getMean(const StatType& stat); template typename RelatedTypes::fractional_t getMean(SampleStatHandle& stat) { - return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); } - F64 getStandardDeviation(const TraceType& stat); + F64 getStandardDeviation(const StatType& stat); template typename RelatedTypes::fractional_t getStandardDeviation(const SampleStatHandle& stat) { - return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); } - F64 getLastValue(const TraceType& stat); + F64 getLastValue(const StatType& stat); template T getLastValue(const SampleStatHandle& stat) { - return (T)getLastValue(static_cast&> (stat)); + return (T)getLastValue(static_cast&> (stat)); } - S32 getSampleCount(const TraceType& stat); + S32 getSampleCount(const StatType& stat); // EventStatHandle accessors - bool hasValue(const TraceType& stat); + bool hasValue(const StatType& stat); - F64 getSum(const TraceType& stat); + F64 getSum(const StatType& stat); template typename RelatedTypes::sum_t getSum(const EventStatHandle& stat) { - return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); + return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); } - F64 getMin(const TraceType& stat); + F64 getMin(const StatType& stat); template T getMin(const EventStatHandle& stat) { - return (T)getMin(static_cast&> (stat)); + return (T)getMin(static_cast&> (stat)); } - F64 getMax(const TraceType& stat); + F64 getMax(const StatType& stat); template T getMax(const EventStatHandle& stat) { - return (T)getMax(static_cast&> (stat)); + return (T)getMax(static_cast&> (stat)); } - F64 getMean(const TraceType& stat); + F64 getMean(const StatType& stat); template typename RelatedTypes::fractional_t getMean(EventStatHandle& stat) { - return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); } - F64 getStandardDeviation(const TraceType& stat); + F64 getStandardDeviation(const StatType& stat); template typename RelatedTypes::fractional_t getStandardDeviation(const EventStatHandle& stat) { - return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); } - F64 getLastValue(const TraceType& stat); + F64 getLastValue(const StatType& stat); template T getLastValue(const EventStatHandle& stat) { - return (T)getLastValue(static_cast&> (stat)); + return (T)getLastValue(static_cast&> (stat)); } - S32 getSampleCount(const TraceType& stat); + S32 getSampleCount(const StatType& stat); F64Seconds getDuration() const { return mElapsedSeconds; } @@ -342,7 +342,7 @@ namespace LLTrace Recording snapshotCurRecording() const; template - S32 getSampleCount(const TraceType& stat, S32 num_periods = S32_MAX) + S32 getSampleCount(const StatType& 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::value_t getPeriodMin(const TraceType& stat, S32 num_periods = S32_MAX) + typename T::value_t getPeriodMin(const StatType& 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 T getPeriodMin(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast&>(stat), num_periods)); + return T(getPeriodMin(static_cast&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMin(const StatType& stat, S32 num_periods = S32_MAX); template T getPeriodMin(const SampleStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast&>(stat), num_periods)); + return T(getPeriodMin(static_cast&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMin(const StatType& stat, S32 num_periods = S32_MAX); template T getPeriodMin(const EventStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMin(static_cast&>(stat), num_periods)); + return T(getPeriodMin(static_cast&>(stat), num_periods)); } - F64Kilobytes getPeriodMin(const TraceType& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMin(const StatType& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMin(const MemStatHandle& stat, S32 num_periods = S32_MAX); template - typename RelatedTypes::fractional_t getPeriodMinPerSec(const TraceType& stat, S32 num_periods = S32_MAX) + typename RelatedTypes::fractional_t getPeriodMinPerSec(const StatType& 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 RelatedTypes::fractional_t getPeriodMinPerSec(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMinPerSec(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMinPerSec(static_cast&>(stat), num_periods)); } // @@ -426,7 +426,7 @@ namespace LLTrace // catch all for stats that have a defined sum template - typename T::value_t getPeriodMax(const TraceType& stat, S32 num_periods = S32_MAX) + typename T::value_t getPeriodMax(const StatType& 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 T getPeriodMax(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast&>(stat), num_periods)); + return T(getPeriodMax(static_cast&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMax(const StatType& stat, S32 num_periods = S32_MAX); template T getPeriodMax(const SampleStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast&>(stat), num_periods)); + return T(getPeriodMax(static_cast&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMax(const StatType& stat, S32 num_periods = S32_MAX); template T getPeriodMax(const EventStatHandle& stat, S32 num_periods = S32_MAX) { - return T(getPeriodMax(static_cast&>(stat), num_periods)); + return T(getPeriodMax(static_cast&>(stat), num_periods)); } - F64Kilobytes getPeriodMax(const TraceType& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMax(const StatType& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMax(const MemStatHandle& stat, S32 num_periods = S32_MAX); template - typename RelatedTypes::fractional_t getPeriodMaxPerSec(const TraceType& stat, S32 num_periods = S32_MAX) + typename RelatedTypes::fractional_t getPeriodMaxPerSec(const StatType& 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 RelatedTypes::fractional_t getPeriodMaxPerSec(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMaxPerSec(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMaxPerSec(static_cast&>(stat), num_periods)); } // @@ -490,7 +490,7 @@ namespace LLTrace // catch all for stats that have a defined sum template - typename RelatedTypes::fractional_t getPeriodMean(const TraceType& stat, S32 num_periods = S32_MAX) + typename RelatedTypes::fractional_t getPeriodMean(const StatType& 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 RelatedTypes::fractional_t getPeriodMean(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMean(const StatType& stat, S32 num_periods = S32_MAX); template typename RelatedTypes::fractional_t getPeriodMean(const SampleStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodMean(const StatType& stat, S32 num_periods = S32_MAX); template typename RelatedTypes::fractional_t getPeriodMean(const EventStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); } - F64Kilobytes getPeriodMean(const TraceType& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMean(const StatType& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodMean(const MemStatHandle& stat, S32 num_periods = S32_MAX); template - typename RelatedTypes::fractional_t getPeriodMeanPerSec(const TraceType& stat, S32 num_periods = S32_MAX) + typename RelatedTypes::fractional_t getPeriodMeanPerSec(const StatType& 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 RelatedTypes::fractional_t getPeriodMeanPerSec(const CountStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodMeanPerSec(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMeanPerSec(static_cast&>(stat), num_periods)); } // // PERIODIC STANDARD DEVIATION // - F64 getPeriodStandardDeviation(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodStandardDeviation(const StatType& stat, S32 num_periods = S32_MAX); template typename RelatedTypes::fractional_t getPeriodStandardDeviation(const SampleStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodStandardDeviation(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodStandardDeviation(static_cast&>(stat), num_periods)); } - F64 getPeriodStandardDeviation(const TraceType& stat, S32 num_periods = S32_MAX); + F64 getPeriodStandardDeviation(const StatType& stat, S32 num_periods = S32_MAX); template typename RelatedTypes::fractional_t getPeriodStandardDeviation(const EventStatHandle& stat, S32 num_periods = S32_MAX) { - return typename RelatedTypes::fractional_t(getPeriodStandardDeviation(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodStandardDeviation(static_cast&>(stat), num_periods)); } - F64Kilobytes getPeriodStandardDeviation(const TraceType& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodStandardDeviation(const StatType& stat, S32 num_periods = S32_MAX); F64Kilobytes getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods = S32_MAX); private: -- cgit v1.2.3