diff options
author | Richard Linden <none@none> | 2012-10-15 19:43:35 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2012-10-15 19:43:35 -0700 |
commit | 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 (patch) | |
tree | 90c7fdd0a64a2364d3e7ab636f467a776c2f1676 /indra/llcommon | |
parent | 041dfccd1ea5b59c1b3c4e37e9a5495cad342c8f (diff) |
SH-3405 WIP convert existing stats to lltrace system
converted all remaining LLViewerStats to lltrace
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llstatenums.h | 2 | ||||
-rw-r--r-- | indra/llcommon/lltrace.h | 1 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 15 | ||||
-rw-r--r-- | indra/llcommon/llunit.h | 4 |
4 files changed, 20 insertions, 2 deletions
diff --git a/indra/llcommon/llstatenums.h b/indra/llcommon/llstatenums.h index 81c4085d16..ab9b6709e8 100644 --- a/indra/llcommon/llstatenums.h +++ b/indra/llcommon/llstatenums.h @@ -26,7 +26,7 @@ #ifndef LL_LLSTATENUMS_H #define LL_LLSTATENUMS_H -enum +enum ESimStatID { LL_SIM_STAT_TIME_DILATION = 0, LL_SIM_STAT_FPS = 1, diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 221c226ad1..3e19c83bd7 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -282,6 +282,7 @@ namespace LLTrace T getLastValue() const { return mLastValue; } F64 getMean() const { return mMean; } F64 getStandardDeviation() const { return sqrtf(mVarianceSum / mNumSamples); } + U32 getSampleCount() const { return mNumSamples; } private: T mSum, diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index d9ac8c327a..bd4b944e5a 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -168,6 +168,12 @@ namespace LLTrace return (typename Measurement<T, IS_UNIT>::base_unit_t)stat.getAccumulator(mMeasurements).getLastValue(); } + template <typename T, typename IS_UNIT> + U32 getSampleCount(const Measurement<T, IS_UNIT>& stat) const + { + return stat.getAccumulator(mMeasurements).getSampleCount(); + } + F64 getDuration() const { return mElapsedSeconds; } // implementation for LLVCRControlsMixin @@ -208,7 +214,7 @@ namespace LLTrace return mRecordingPeriods[(mCurPeriod + mNumPeriods - 1) % mNumPeriods]; } - Recording& getCurRecordingPeriod() + Recording getCurRecordingPeriod() { return mRecordingPeriods[mCurPeriod]; } @@ -218,6 +224,13 @@ namespace LLTrace return mRecordingPeriods[mCurPeriod]; } + Recording snapshotCurRecordingPeriod() const + { + Recording recording_copy(getCurRecordingPeriod()); + recording_copy.stop(); + return recording_copy; + } + Recording& getTotalRecording(); private: diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 090e42607e..e8f6b2b2ba 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -261,6 +261,10 @@ namespace LLUnits LL_DECLARE_DERIVED_UNIT(Seconds, Microseconds, (1.f / (1000000.f))); LL_DECLARE_DERIVED_UNIT(Seconds, Nanoseconds, (1.f / (1000000000.f))); + LL_DECLARE_BASE_UNIT(Meters); + LL_DECLARE_DERIVED_UNIT(Meters, Kilometers, 1000); + LL_DECLARE_DERIVED_UNIT(Meters, Centimeters, 1 / 100); + LL_DECLARE_DERIVED_UNIT(Meters, Millimeters, 1 / 1000); } #endif // LL_LLUNIT_H |