From 13e4edf1cd664864afa585bc83bbe99d4f743326 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 2 Dec 2012 23:00:36 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system started moving fast timer historical stats over to LLTrace periodic recording --- indra/llcommon/lltracerecording.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'indra/llcommon/lltracerecording.h') diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index e5a21a2d38..0adea2663b 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -118,6 +118,10 @@ namespace LLTrace void update(); + // Timer accessors + LLUnit getSum(const TraceType& stat) const; + LLUnit getPerSec(const TraceType& stat) const; + // Count accessors F64 getSum(const TraceType >& stat) const; S64 getSum(const TraceType >& stat) const; @@ -273,18 +277,18 @@ namespace LLTrace Recording& getTotalRecording(); template - typename T getPeriodMin(const TraceType >& stat) const + typename T::value_t getPeriodMin(const TraceType& stat) const { - T min_val = (std::numeric_limits::max)(); + typename T::value_t min_val = (std::numeric_limits::max)(); for (S32 i = 0; i < mNumPeriods; i++) { min_val = llmin(min_val, mRecordingPeriods[i].getSum(stat)); } - return (T)min_val; + return min_val; } template - F64 getPeriodMinPerSec(const TraceType >& stat) const + F64 getPeriodMinPerSec(const TraceType& stat) const { F64 min_val = (std::numeric_limits::max)(); for (S32 i = 0; i < mNumPeriods; i++) @@ -295,9 +299,9 @@ namespace LLTrace } template - T getPeriodMax(const TraceType >& stat) const + typename T::value_t getPeriodMax(const TraceType& stat) const { - T max_val = (std::numeric_limits::min)(); + typename T::value_t max_val = (std::numeric_limits::min)(); for (S32 i = 0; i < mNumPeriods; i++) { max_val = llmax(max_val, mRecordingPeriods[i].getSum(stat)); @@ -306,7 +310,7 @@ namespace LLTrace } template - F64 getPeriodMaxPerSec(const TraceType >& stat) const + F64 getPeriodMaxPerSec(const TraceType& stat) const { F64 max_val = (std::numeric_limits::min)(); for (S32 i = 0; i < mNumPeriods; i++) @@ -317,7 +321,7 @@ namespace LLTrace } template - F64 getPeriodMean(const TraceType >& stat) const + F64 getPeriodMean(const TraceType& stat) const { F64 mean = 0.0; F64 count = 0; @@ -334,7 +338,7 @@ namespace LLTrace } template - F64 getPeriodMeanPerSec(const TraceType >& stat) const + F64 getPeriodMeanPerSec(const TraceType& stat) const { F64 mean = 0.0; F64 count = 0; -- cgit v1.2.3