From 18aedf0241ba893e12140c0a3855f328d2b4eded Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 17 Oct 2013 19:18:53 -0700 Subject: fix for assert at runtime (reading stats from recording while it was active) fix for bad values returns from getPeriodMin and getPeriodMax on count stats when no counts recorded fix for gcc compile time error (typename ftw) --- indra/llcommon/lltracerecording.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/lltracerecording.cpp') diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 2b2b55f614..6ad6bbe356 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -137,6 +137,12 @@ void Recording::appendRecording( Recording& other ) mElapsedSeconds += other.mElapsedSeconds; } +bool Recording::hasValue(const StatType& stat) +{ + llassert(!isStarted()); + return mBuffers->mStackTimers[stat.getIndex()].hasValue(); +} + F64Seconds Recording::getSum(const StatType& stat) { llassert(!isStarted()); @@ -219,6 +225,12 @@ F64Kilobytes Recording::getLastValue(const StatType& stat) return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); } +bool Recording::hasValue(const StatType& stat) +{ + llassert(!isStarted()); + return mBuffers->mMemStats[stat.getIndex()].mAllocations.hasValue(); +} + F64Kilobytes Recording::getSum(const StatType& stat) { llassert(!isStarted()); @@ -237,6 +249,13 @@ S32 Recording::getSampleCount(const StatType& s return mBuffers->mMemStats[stat.getIndex()].mAllocations.getSampleCount(); } +bool Recording::hasValue(const StatType& stat) +{ + llassert(!isStarted()); + return mBuffers->mMemStats[stat.getIndex()].mDeallocations.hasValue(); +} + + F64Kilobytes Recording::getSum(const StatType& stat) { llassert(!isStarted()); @@ -255,13 +274,19 @@ S32 Recording::getSampleCount(const StatType& return mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSampleCount(); } -F64 Recording::getSum( const StatType& stat ) +bool Recording::hasValue(const StatType& stat) +{ + llassert(!isStarted()); + return mBuffers->mCounts[stat.getIndex()].hasValue(); +} + +F64 Recording::getSum(const StatType& stat) { llassert(!isStarted()); return mBuffers->mCounts[stat.getIndex()].getSum(); } -F64 Recording::getSum( const StatType& stat ) +F64 Recording::getSum( const StatType& stat) { llassert(!isStarted()); return (F64)mBuffers->mEvents[stat.getIndex()].getSum(); -- cgit v1.3