From 0127e66228acd41402da9acab8ce91d394c3096f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Jul 2013 16:42:22 -0700 Subject: stat bars with no stats now show n/a instead of o --- indra/llcommon/lltracerecording.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/llcommon/lltracerecording.h') diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 31616a52cc..f5e4ea603c 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -333,6 +333,21 @@ namespace LLTrace const Recording& getPrevRecording(U32 offset) const; Recording snapshotCurRecording() const; + template + size_t getSampleCount(const TraceType& stat, size_t num_periods = U32_MAX) + { + size_t total_periods = mNumPeriods; + num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + + size_t num_samples = 0; + for (S32 i = 1; i <= num_periods; i++) + { + S32 index = (mCurPeriod + total_periods - i) % total_periods; + num_samples += mRecordingPeriods[index].getSampleCount(stat); + } + return num_samples; + } + // // PERIODIC MIN // -- cgit v1.2.3