diff options
author | Richard Linden <none@none> | 2013-03-21 00:37:20 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-03-21 00:37:20 -0700 |
commit | 1f507c3cfca0c7722ebeaf71883fbaa83988e1a9 (patch) | |
tree | c944ece26361162c2e405c710643fc43e3bc022d /indra/llcommon/lltracerecording.cpp | |
parent | 452d3350a241695d962dc58403ce4e35541b6353 (diff) |
SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
copied over scene load frame differencing changes from viewer-interesting
made periodicrecording flexible enough to allow for indefinite number of periods
added scene loading stats floater
fixed collapsing behavior of container views
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 259f5a7a27..5d74ea32df 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -355,41 +355,30 @@ U32 Recording::getSampleCount( const TraceType<MeasurementAccumulator<S64> >& st // PeriodicRecording /////////////////////////////////////////////////////////////////////// -PeriodicRecording::PeriodicRecording( S32 num_periods, EPlayState state) -: mNumPeriods(num_periods), +PeriodicRecording::PeriodicRecording( U32 num_periods, EPlayState state) +: mAutoResize(num_periods == 0), mCurPeriod(0), - mTotalValid(false), - mRecordingPeriods( new Recording[num_periods]) + mTotalValid(false) { - llassert(mNumPeriods > 0); - setPlayState(state); -} - -PeriodicRecording::PeriodicRecording(PeriodicRecording& other) -: mNumPeriods(other.mNumPeriods), - mCurPeriod(other.mCurPeriod), - mTotalValid(other.mTotalValid), - mTotalRecording(other.mTotalRecording) -{ - mRecordingPeriods = new Recording[mNumPeriods]; - for (S32 i = 0; i < mNumPeriods; i++) + if (num_periods) { - mRecordingPeriods[i] = other.mRecordingPeriods[i]; + mRecordingPeriods.resize(num_periods); } + setPlayState(state); } - -PeriodicRecording::~PeriodicRecording() -{ - delete[] mRecordingPeriods; -} - - void PeriodicRecording::nextPeriod() { EPlayState play_state = getPlayState(); Recording& old_recording = getCurRecordingPeriod(); - mCurPeriod = (mCurPeriod + 1) % mNumPeriods; + if (mAutoResize) + { + mRecordingPeriods.push_back(Recording()); + } + U32 num_periods = mRecordingPeriods.size(); + mCurPeriod = (num_periods > 0) + ? (mCurPeriod + 1) % num_periods + : mCurPeriod + 1; old_recording.splitTo(getCurRecordingPeriod()); switch(play_state) @@ -412,9 +401,21 @@ Recording& PeriodicRecording::getTotalRecording() if (!mTotalValid) { mTotalRecording.reset(); - for (S32 i = mCurPeriod + 1; i < mCurPeriod + mNumPeriods; i++) + U32 num_periods = mRecordingPeriods.size(); + + if (num_periods) + { + for (S32 i = mCurPeriod + 1; i < mCurPeriod + num_periods; i++) + { + mTotalRecording.appendRecording(mRecordingPeriods[i % num_periods]); + } + } + else { - mTotalRecording.appendRecording(mRecordingPeriods[i % mNumPeriods]); + for (S32 i = 0; i < mCurPeriod; i++) + { + mTotalRecording.appendRecording(mRecordingPeriods[i]); + } } } mTotalValid = true; |