diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-06-13 09:15:42 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-06-13 09:15:42 -0400 |
commit | 93bafda56b7ba006da3a14a6c6783e235413176a (patch) | |
tree | b9e3abc0f1617fd76cc55ef8c36b0529ebb3f3e8 /indra/llcommon | |
parent | dcb8880f29bf8ce51e4532366477d9bf026d1abd (diff) |
MAINT-6366 - diagnostics related to animation asset downloads
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 0b10438b9f..3094b627a2 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -257,7 +257,13 @@ F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat) if (active_accumulator && active_accumulator->mSize.hasValue()) { - return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), active_accumulator->mSize.getSampleCount() / (accumulator.mSize.getSampleCount() + active_accumulator->mSize.getSampleCount()))); + F32 t = 0.0f; + S32 div = accumulator.mSize.getSampleCount() + active_accumulator->mSize.getSampleCount(); + if (div > 0) + { + t = active_accumulator->mSize.getSampleCount() / div; + } + return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), t)); } else { @@ -426,7 +432,13 @@ F64 Recording::getMean( const StatType<SampleAccumulator>& stat ) const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL; if (active_accumulator && active_accumulator->hasValue()) { - return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount())); + F32 t = 0.0f; + S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount(); + if (div > 0) + { + t = active_accumulator->getSampleCount() / div; + } + return lerp(accumulator.getMean(), active_accumulator->getMean(), t); } else { @@ -506,7 +518,13 @@ F64 Recording::getMean( const StatType<EventAccumulator>& stat ) const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL; if (active_accumulator && active_accumulator->hasValue()) { - return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount())); + F32 t = 0.0f; + S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount(); + if (div > 0) + { + t = active_accumulator->getSampleCount() / div; + } + return lerp(accumulator.getMean(), active_accumulator->getMean(), t); } else { |