From f58eb60b1e0bbdf2148255c61100cbc20d1ba1b0 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Aug 2013 08:17:21 -0700 Subject: SH-4374 WIP Interesting: Statistics Object cache hit rate is always 100% --- indra/llcommon/lltracerecording.cpp | 17 ++++++++++++++--- indra/llcommon/lltracerecording.h | 1 + indra/llui/llstatbar.cpp | 2 +- indra/newview/llviewerobjectlist.cpp | 4 ++-- 4 files changed, 18 insertions(+), 6 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& stat ) return mBuffers->mCounts[stat.getIndex()].getSampleCount(); } +bool Recording::hasValue(const TraceType& stat) +{ + return mBuffers->mSamples[stat.getIndex()].hasValue(); +} + F64 Recording::getMin( const TraceType& stat ) { return mBuffers->mSamples[stat.getIndex()].getMin(); @@ -578,7 +583,10 @@ F64 PeriodicRecording::getPeriodMin( const TraceType& 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& 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& 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 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 f5e4ea603c..51b411b7bd 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -209,6 +209,7 @@ namespace LLTrace // SampleStatHandle accessors + bool hasValue(const TraceType& stat); F64 getMin(const TraceType& stat); template T getMin(const SampleStatHandle& stat) diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 1af36c6fdb..ee73cfa40d 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 4072ab524e..e50e666421 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; -- cgit v1.2.3