summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-12-06 00:37:15 -0800
committerRichard Linden <none@none>2012-12-06 00:37:15 -0800
commit60800dacdd7e9b66ed654af471f2b9e9680cd981 (patch)
treef71a65d1ab8a4d277a1ccbd109d852fcc00cba13 /indra/llcommon/lltracerecording.h
parent68967e7b2b9416ff66cb49ae755fb33d7b81d129 (diff)
SH-3406 WIP convert fast timers to lltrace system
fixed gcc compile error made LLCopyOnWritePointer contain an LLPointer, not derive from it added type trait to control periodicrecording mean value type
Diffstat (limited to 'indra/llcommon/lltracerecording.h')
-rw-r--r--indra/llcommon/lltracerecording.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
index a3af215dd3..6fd1a105d3 100644
--- a/indra/llcommon/lltracerecording.h
+++ b/indra/llcommon/lltracerecording.h
@@ -326,36 +326,32 @@ namespace LLTrace
}
template <typename T>
- F64 getPeriodMean(const TraceType<T>& stat) const
+ typename TraceType<T>::mean_t getPeriodMean(const TraceType<T>& stat) const
{
- F64 mean = 0.0;
- F64 count = 0;
+ typename TraceType<T>::mean_t mean = 0.0;
for (S32 i = 0; i < mNumPeriods; i++)
{
if (mRecordingPeriods[i].getDuration() > 0.f)
{
- count++;
mean += mRecordingPeriods[i].getSum(stat);
}
}
- mean /= (F64)mNumPeriods;
+ mean /= mNumPeriods;
return mean;
}
template <typename T>
- F64 getPeriodMeanPerSec(const TraceType<T>& stat) const
+ typename TraceType<T>::mean_t getPeriodMeanPerSec(const TraceType<T>& stat) const
{
- F64 mean = 0.0;
- F64 count = 0;
+ typename TraceType<T>::mean_t mean = 0.0;
for (S32 i = 0; i < mNumPeriods; i++)
{
if (mRecordingPeriods[i].getDuration() > 0.f)
{
- count++;
mean += mRecordingPeriods[i].getPerSec(stat);
}
}
- mean /= count;
+ mean /= mNumPeriods;
return mean;
}