summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-07-23 16:42:22 -0700
committerRichard Linden <none@none>2013-07-23 16:42:22 -0700
commit0127e66228acd41402da9acab8ce91d394c3096f (patch)
tree5b4016402e3a1c7c09ae99f6a397f4cb5fb9598f /indra/llcommon/lltracerecording.h
parent40a7c63e897cee5905270602be4387f5eb4fc2b8 (diff)
stat bars with no stats now show n/a instead of o
Diffstat (limited to 'indra/llcommon/lltracerecording.h')
-rw-r--r--indra/llcommon/lltracerecording.h15
1 files changed, 15 insertions, 0 deletions
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 <typename T>
+ size_t getSampleCount(const TraceType<T>& 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
//