summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerstats.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-05 16:17:24 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-11-05 16:17:24 -0400
commitddff1c68f22fbee00178d223eaac382836dba5f7 (patch)
tree798cb45310cfa22ae363be80d394e22f3dd84fd8 /indra/newview/llviewerstats.h
parent7863674626bcf16ad26f3bb8e77a6ca41998c36b (diff)
additional analysis for --analyzeperformance option
Diffstat (limited to 'indra/newview/llviewerstats.h')
-rwxr-xr-x[-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 ca977d4599..af65fe0488 100644..100755
--- 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;
}
};