summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstats.h
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-05-24 10:51:09 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-05-24 10:51:09 -0700
commit3dfb4944ed916f9a251078a2614a854b9de0315d (patch)
tree251a82d2511132632d12e36c8e8be0d7bf5b11cf /indra/newview/llviewerstats.h
parent1a5b3b0a9091a72fd5e5fb395f7f0c97b0fd502c (diff)
parente5752934be74a84e6ec0ff8cb96974bd1e9060ec (diff)
Merge latest from lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llviewerstats.h')
-rw-r--r--indra/newview/llviewerstats.h31
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;
}
};