diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 2150a44f1269eb7be889dd111d599e804a0bd56b..9fce6c11ccc589084460a55ef42280fd842efa48 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(); diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index f5e4ea603cb507aaf2dd34a453910596159d019d..51b411b7bdc6df7f744507b678ceec7c28dd2826 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -209,6 +209,7 @@ namespace LLTrace // SampleStatHandle accessors + bool hasValue(const TraceType<SampleAccumulator>& stat); F64 getMin(const TraceType<SampleAccumulator>& stat); template <typename T> T getMin(const SampleStatHandle<T>& stat) diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1af36c6fdb5233060d6154dc102e5cd8e46e3070..ee73cfa40daf9a7ed4e71bc8ea9f54d448aeb274 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -272,7 +272,7 @@ void LLStatBar::draw() mean = frame_recording.getPeriodMean(*mSampleFloatp, num_frames); // always show sample data if we've ever grabbed any samples - show_data = mSampleFloatp->getPrimaryAccumulator()->hasValue(); + show_data = last_frame_recording.hasValue(*mSampleFloatp); } S32 bar_top, bar_left, bar_right, bar_bottom; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 4072ab524e0a27f2ca44b22baf850290763d95f9..e50e66642116c139f90f20f09f3a1ff7f4f5d10d 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -355,7 +355,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* } justCreated = true; mNumNewObjects++; - sample(sCacheHitRate, LLUnits::Percent::fromValue(100.f)); + sample(sCacheHitRate, LLUnits::Ratio::fromValue(1)); } if (objectp->isDead()) @@ -697,7 +697,7 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys, continue; // no data packer, skip this object } - sample(sCacheHitRate, 100.f); + //sample(sCacheHitRate, LLUnits::Ratio::fromValue(0)); } return;