diff options
author | Debi King (Dessie) <dessie@lindenlab.com> | 2011-05-26 18:34:41 -0400 |
---|---|---|
committer | Debi King (Dessie) <dessie@lindenlab.com> | 2011-05-26 18:34:41 -0400 |
commit | d5f96c38e6f5838672c87e540aaaa3b1663837f8 (patch) | |
tree | 3aac617ceed3eb3ae2a1aa6cfaca9bb96d4ff4c7 /indra/newview/llviewerstats.h | |
parent | 84202f19a52b8d04bf900a72acf4214b73acc820 (diff) | |
parent | 4b7793a119f4e4c8c4f03b6ff9adb0eb6fe94209 (diff) |
merge from viewer-pre-beta
Diffstat (limited to 'indra/newview/llviewerstats.h')
-rw-r--r-- | indra/newview/llviewerstats.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 3f9cfb9d9b..f91a1241fe 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -196,8 +196,15 @@ public: S32 mCount; F32 mSum; F32 mSumOfSquares; + F32 mMinValue; + F32 mMaxValue; U32 mCountOfNextUpdatesToIgnore; + inline StatsAccumulator() + { + reset(); + } + inline void push( F32 val ) { if ( mCountOfNextUpdatesToIgnore > 0 ) @@ -209,13 +216,31 @@ public: mCount++; mSum += val; mSumOfSquares += val * val; + if (mCount == 1 || val > mMaxValue) + { + mMaxValue = val; + } + if (mCount == 1 || val < mMinValue) + { + mMinValue = val; + } } inline F32 getMean() const { return (mCount == 0) ? 0.f : ((F32)mSum)/mCount; } - + + inline F32 getMinValue() const + { + return mMinValue; + } + + inline F32 getMaxValue() const + { + return mMaxValue; + } + inline F32 getStdDev() const { const F32 mean = getMean(); @@ -231,6 +256,8 @@ public: { mCount = 0; mSum = mSumOfSquares = 0.f; + mMinValue = 0.0f; + mMaxValue = 0.0f; mCountOfNextUpdatesToIgnore = 0; } @@ -240,6 +267,8 @@ public: data["mean"] = getMean(); data["std_dev"] = getStdDev(); data["count"] = (S32)mCount; + data["min"] = getMinValue(); + data["max"] = getMaxValue(); return data; } }; |