summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-10-09 18:02:47 -0700
committerRichard Linden <none@none>2012-10-09 18:02:47 -0700
commitaff9654c1115b4a74fc3ee8f9ca2c2ffa07f8d73 (patch)
tree4cbd07cad7b3d912324aee7513fb5462bab9d13b /indra/llcommon/lltracerecording.cpp
parent3960fdf9e01619ddfd7903bcdd8d894f432752d0 (diff)
SH-3275 WIP Update viewer metrics system to be more flexible
added PeriodicRecorder class for frame by frame stats accumulation
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r--indra/llcommon/lltracerecording.cpp35
1 files changed, 13 insertions, 22 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index e4cff551f9..7cd6280f03 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -38,7 +38,6 @@ namespace LLTrace
Recording::Recording()
: mElapsedSeconds(0),
- mIsStarted(false),
mRates(new AccumulatorBuffer<RateAccumulator<F32> >()),
mMeasurements(new AccumulatorBuffer<MeasurementAccumulator<F32> >()),
mStackTimers(new AccumulatorBuffer<TimerAccumulator>())
@@ -47,13 +46,7 @@ Recording::Recording()
Recording::~Recording()
{}
-void Recording::start()
-{
- reset();
- resume();
-}
-
-void Recording::reset()
+void Recording::handleReset()
{
mRates.write()->reset();
mMeasurements.write()->reset();
@@ -63,24 +56,22 @@ void Recording::reset()
mSamplingTimer.reset();
}
-void Recording::resume()
+void Recording::handleStart()
+{
+ mSamplingTimer.reset();
+ LLTrace::get_thread_recorder()->activate(this);
+}
+
+void Recording::handleStop()
{
- if (!mIsStarted)
- {
- mSamplingTimer.reset();
- LLTrace::get_thread_recorder()->activate(this);
- mIsStarted = true;
- }
+ mElapsedSeconds += mSamplingTimer.getElapsedTimeF64();
+ LLTrace::get_thread_recorder()->deactivate(this);
}
-void Recording::stop()
+void Recording::handleSplitTo(Recording& other)
{
- if (mIsStarted)
- {
- mElapsedSeconds += mSamplingTimer.getElapsedTimeF64();
- LLTrace::get_thread_recorder()->deactivate(this);
- mIsStarted = false;
- }
+ stop();
+ other.restart();
}