summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-08-01 08:17:21 -0700
committerRichard Linden <none@none>2013-08-01 08:17:21 -0700
commitf58eb60b1e0bbdf2148255c61100cbc20d1ba1b0 (patch)
tree70df47e3863ca1e1c499714e7bb0197e3acf753a /indra/llcommon/lltracerecording.cpp
parente87ba587555d2a70e87dd0b204be2d586920d50f (diff)
SH-4374 WIP Interesting: Statistics Object cache hit rate is always 100%
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r--indra/llcommon/lltracerecording.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 2150a44f12..9fce6c11cc 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -252,6 +252,11 @@ U32 Recording::getSampleCount( const TraceType<CountAccumulator>& stat )
return mBuffers->mCounts[stat.getIndex()].getSampleCount();
}
+bool Recording::hasValue(const TraceType<SampleAccumulator>& stat)
+{
+ return mBuffers->mSamples[stat.getIndex()].hasValue();
+}
+
F64 Recording::getMin( const TraceType<SampleAccumulator>& stat )
{
return mBuffers->mSamples[stat.getIndex()].getMin();
@@ -578,7 +583,10 @@ F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, s
for (S32 i = 1; i <= num_periods; i++)
{
S32 index = (mCurPeriod + total_periods - i) % total_periods;
- min_val = llmin(min_val, mRecordingPeriods[index].getMin(stat));
+ if (mRecordingPeriods[index].hasValue(stat))
+ {
+ min_val = llmin(min_val, mRecordingPeriods[index].getMin(stat));
+ }
}
return min_val;
}
@@ -592,7 +600,10 @@ F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, si
for (S32 i = 1; i <= num_periods; i++)
{
S32 index = (mCurPeriod + total_periods - i) % total_periods;
- max_val = llmax(max_val, mRecordingPeriods[index].getMax(stat));
+ if (mRecordingPeriods[index].hasValue(stat))
+ {
+ max_val = llmax(max_val, mRecordingPeriods[index].getMax(stat));
+ }
}
return max_val;
}
@@ -611,7 +622,7 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat,
for (S32 i = 1; i <= num_periods; i++)
{
S32 index = (mCurPeriod + total_periods - i) % total_periods;
- if (mRecordingPeriods[index].getDuration() > 0.f)
+ if (mRecordingPeriods[index].getDuration() > 0.f && mRecordingPeriods[index].hasValue(stat))
{
LLUnit<F64, LLUnits::Seconds> recording_duration = mRecordingPeriods[index].getDuration();
mean += mRecordingPeriods[index].getMean(stat) * recording_duration.value();