summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-05-20 00:01:57 -0700
committerRichard Linden <none@none>2013-05-20 00:01:57 -0700
commitf850ae03b399a5cc7aa32f82b8ed996518a86a2a (patch)
tree234c52cd26a804b35973f273b80d03a356f3142b /indra/llcommon/lltracerecording.cpp
parent116d37b4d5883e6020f24ee9c660e9e4511a1574 (diff)
SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
fixed copy construction of Recorders, eliminated most zero-length frames fixed reset behavior of periodic recordings and extendable recordings to clear entire history removed busy-loop recording of stats from worker threads...stats reported only when work is done
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r--indra/llcommon/lltracerecording.cpp38
1 files changed, 28 insertions, 10 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 6b5c6c7d3e..4aa3a5a0f7 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -133,11 +133,19 @@ Recording::Recording()
{}
Recording::Recording( const Recording& other )
-: RecordingBuffers(other),
- mElapsedSeconds(other.mElapsedSeconds),
- mSamplingTimer(other.mSamplingTimer)
+: mSamplingTimer(other.mSamplingTimer)
{
- LLStopWatchControlsMixin<Recording>::setPlayState(other.getPlayState());
+ Recording& mutable_other = const_cast<Recording&>(other);
+ EPlayState other_play_state = other.getPlayState();
+ mutable_other.pause();
+
+ appendBuffers(other);
+
+ LLStopWatchControlsMixin<Recording>::setPlayState(other_play_state);
+ mutable_other.setPlayState(other_play_state);
+
+ // above call will clear mElapsedSeconds as a side effect, so copy it here
+ mElapsedSeconds = other.mElapsedSeconds;
}
@@ -380,9 +388,7 @@ void PeriodicRecording::nextPeriod()
Recording& old_recording = getCurRecording();
- mCurPeriod = mRecordingPeriods.empty()
- ? mCurPeriod + 1
- : (mCurPeriod + 1) % mRecordingPeriods.size();
+ mCurPeriod = (mCurPeriod + 1) % mRecordingPeriods.size();
old_recording.splitTo(getCurRecording());
}
@@ -526,9 +532,22 @@ void PeriodicRecording::handleStop()
void PeriodicRecording::handleReset()
{
- mRecordingPeriods.clear();
- mRecordingPeriods.push_back(Recording());
+ if (mAutoResize)
+ {
+ mRecordingPeriods.clear();
+ mRecordingPeriods.push_back(Recording());
+ }
+ else
+ {
+ for (std::vector<Recording>::iterator it = mRecordingPeriods.begin(), end_it = mRecordingPeriods.end();
+ it != end_it;
+ ++it)
+ {
+ it->reset();
+ }
+ }
mCurPeriod = 0;
+ getCurRecording().setPlayState(getPlayState());
}
void PeriodicRecording::handleSplitTo(PeriodicRecording& other)
@@ -656,7 +675,6 @@ void LLStopWatchControlsMixinCommon::stop()
case STOPPED:
break;
case PAUSED:
- handleStop();
break;
case STARTED:
handleStop();