diff options
author | Richard Linden <none@none> | 2012-10-12 20:17:52 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2012-10-12 20:17:52 -0700 |
commit | 041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f (patch) | |
tree | 27f7785f0cf095ec69816c5ed877ff605dbf6789 /indra/llcommon/lltracerecording.h | |
parent | 0f58ca02cdec62711eadb82ba28fcff08faef2ee (diff) |
SH-3405 WIP convert existing stats to lltrace system
default to double precision now
fixed unit conversion logic for LLUnit
renamed LLTrace::Rate to LLTrace::Count and got rid of the old count as it was confusing
some const correctness changes
Diffstat (limited to 'indra/llcommon/lltracerecording.h')
-rw-r--r-- | indra/llcommon/lltracerecording.h | 69 |
1 files changed, 10 insertions, 59 deletions
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 924a7bffd5..d9ac8c327a 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -111,17 +111,17 @@ namespace LLTrace void update(); - // Rate accessors + // Count accessors template <typename T, typename IS_UNIT> - typename Rate<T, IS_UNIT>::base_unit_t getSum(const Rate<T, IS_UNIT>& stat) const + typename Count<T, IS_UNIT>::base_unit_t getSum(const Count<T, IS_UNIT>& stat) const { - return (typename Rate<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mRates).getSum(); + return (typename Count<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mCounts).getSum(); } template <typename T, typename IS_UNIT> - typename Rate<T, IS_UNIT>::base_unit_t getPerSec(const Rate<T, IS_UNIT>& stat) const + typename Count<T, IS_UNIT>::base_unit_t getPerSec(const Count<T, IS_UNIT>& stat) const { - return (typename Rate<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mRates).getSum() / mElapsedSeconds; + return (typename Count<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mCounts).getSum() / mElapsedSeconds; } // Measurement accessors @@ -135,7 +135,7 @@ namespace LLTrace template <typename T, typename IS_UNIT> typename Measurement<T, IS_UNIT>::base_unit_t getPerSec(const Measurement<T, IS_UNIT>& stat) const { - return (typename Rate<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mMeasurements).getSum() / mElapsedSeconds; + return (typename Count<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mMeasurements).getSum() / mElapsedSeconds; } template <typename T, typename IS_UNIT> @@ -151,7 +151,7 @@ namespace LLTrace } template <typename T, typename IS_UNIT> - typename Measurement<T, IS_UNIT>::base_unit_t getMean(const Measurement<T, IS_UNIT>& stat) const + typename Measurement<T, IS_UNIT>::base_unit_t getMean(Measurement<T, IS_UNIT>& stat) const { return (typename Measurement<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mMeasurements).getMean(); } @@ -168,56 +168,7 @@ namespace LLTrace return (typename Measurement<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mMeasurements).getLastValue(); } - // Count accessors - template <typename T> - typename Count<T>::base_unit_t getSum(const Count<T>& stat) const - { - return getSum(stat.mTotal); - } - - template <typename T> - typename Count<T>::base_unit_t getPerSec(const Count<T>& stat) const - { - return getPerSec(stat.mTotal); - } - - template <typename T> - typename Count<T>::base_unit_t getIncrease(const Count<T>& stat) const - { - return getPerSec(stat.mTotal); - } - - template <typename T> - typename Count<T>::base_unit_t getIncreasePerSec(const Count<T>& stat) const - { - return getPerSec(stat.mIncrease); - } - - template <typename T> - typename Count<T>::base_unit_t getDecrease(const Count<T>& stat) const - { - return getPerSec(stat.mDecrease); - } - - template <typename T> - typename Count<T>::base_unit_t getDecreasePerSec(const Count<T>& stat) const - { - return getPerSec(stat.mDecrease); - } - - template <typename T> - typename Count<T>::base_unit_t getChurn(const Count<T>& stat) const - { - return getIncrease(stat) + getDecrease(stat); - } - - template <typename T> - typename Count<T>::base_unit_t getChurnPerSec(const Count<T>& stat) const - { - return getIncreasePerSec(stat) + getDecreasePerSec(stat); - } - - F64 getSampleTime() const { return mElapsedSeconds; } + F64 getDuration() const { return mElapsedSeconds; } // implementation for LLVCRControlsMixin /*virtual*/ void handleStart(); @@ -230,8 +181,8 @@ namespace LLTrace // returns data for current thread class ThreadRecorder* getThreadRecorder(); - LLCopyOnWritePointer<AccumulatorBuffer<RateAccumulator<F32> > > mRates; - LLCopyOnWritePointer<AccumulatorBuffer<MeasurementAccumulator<F32> > > mMeasurements; + LLCopyOnWritePointer<AccumulatorBuffer<CountAccumulator<F64> > > mCounts; + LLCopyOnWritePointer<AccumulatorBuffer<MeasurementAccumulator<F64> > > mMeasurements; LLCopyOnWritePointer<AccumulatorBuffer<TimerAccumulator> > mStackTimers; LLTimer mSamplingTimer; |