diff options
author | Dave Parks <davep@lindenlab.com> | 2011-05-16 16:11:56 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-05-16 16:11:56 -0500 |
commit | 26f321bf6530734173792f92316b32c470cc1b20 (patch) | |
tree | b6c913bc714ce29ee559a0da49c6318051637789 /indra/newview/llviewerstats.h | |
parent | 113f532ee57eeeca4dc7eb6ca05f923f1f3543d3 (diff) | |
parent | 8ae550996c70df16b707f6773666b93409123689 (diff) |
merge
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; } }; |