From 60800dacdd7e9b66ed654af471f2b9e9680cd981 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 6 Dec 2012 00:37:15 -0800 Subject: 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 --- indra/llcommon/lltracerecording.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'indra/llcommon/lltracerecording.h') 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 - F64 getPeriodMean(const TraceType& stat) const + typename TraceType::mean_t getPeriodMean(const TraceType& stat) const { - F64 mean = 0.0; - F64 count = 0; + typename TraceType::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 - F64 getPeriodMeanPerSec(const TraceType& stat) const + typename TraceType::mean_t getPeriodMeanPerSec(const TraceType& stat) const { - F64 mean = 0.0; - F64 count = 0; + typename TraceType::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; } -- cgit v1.2.3