From 07ca6fce7c9cffe1b8f215f25bb826fedf57a5b7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 10 Apr 2013 21:51:56 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics removed PeriodicRecording::getTotalRecording as it was showing up at the top on the profiler renamed getPrevRecordingPeriod, etc. to getPrevRecording --- indra/llui/llstatbar.cpp | 37 ++++++++++++++++--------------------- indra/llui/llstatgraph.cpp | 4 ++-- 2 files changed, 18 insertions(+), 23 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index d9f3d14ef0..46eea368e5 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -103,12 +103,11 @@ void LLStatBar::draw() max = 0.f, mean = 0.f; - S32 num_samples = 0; LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); if (mCountFloatp) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); if (mPerSec) { @@ -116,7 +115,6 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(*mCountFloatp); max = frame_recording.getPeriodMaxPerSec(*mCountFloatp); mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountFloatp); } else { @@ -124,12 +122,11 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountFloatp); max = frame_recording.getPeriodMax(*mCountFloatp); mean = frame_recording.getPeriodMean(*mCountFloatp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountFloatp); } } else if (mCountIntp) { - LLTrace::Recording& last_frame_recording = frame_recording.getLastRecordingPeriod(); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); if (mPerSec) { @@ -137,7 +134,6 @@ void LLStatBar::draw() min = frame_recording.getPeriodMinPerSec(*mCountIntp); max = frame_recording.getPeriodMaxPerSec(*mCountIntp); mean = frame_recording.getPeriodMeanPerSec(*mCountIntp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountIntp); } else { @@ -145,26 +141,25 @@ void LLStatBar::draw() min = frame_recording.getPeriodMin(*mCountIntp); max = frame_recording.getPeriodMax(*mCountIntp); mean = frame_recording.getPeriodMean(*mCountIntp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mCountIntp); } } else if (mMeasurementFloatp) { - LLTrace::Recording& recording = frame_recording.getTotalRecording(); - current = recording.getLastValue(*mMeasurementFloatp); - min = recording.getMin(*mMeasurementFloatp); - max = recording.getMax(*mMeasurementFloatp); - mean = recording.getMean(*mMeasurementFloatp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementFloatp); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mMeasurementFloatp); + min = frame_recording.getPeriodMin(*mMeasurementFloatp); + max = frame_recording.getPeriodMax(*mMeasurementFloatp); + mean = frame_recording.getPeriodMean(*mMeasurementFloatp); } else if (mMeasurementIntp) { - LLTrace::Recording& recording = frame_recording.getTotalRecording(); - current = recording.getLastValue(*mMeasurementIntp); - min = recording.getMin(*mMeasurementIntp); - max = recording.getMax(*mMeasurementIntp); - mean = recording.getMean(*mMeasurementIntp); - num_samples = frame_recording.getTotalRecording().getSampleCount(*mMeasurementIntp); + LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); + + current = last_frame_recording.getLastValue(*mMeasurementIntp); + min = frame_recording.getPeriodMin(*mMeasurementIntp); + max = frame_recording.getPeriodMax(*mMeasurementIntp); + mean = frame_recording.getPeriodMean(*mMeasurementIntp); } current *= mUnitScale; @@ -203,7 +198,7 @@ void LLStatBar::draw() const S32 tick_length = 4; const S32 tick_width = 1; - if (mScaleRange && num_samples) + if (mScaleRange && min < max) { F32 cur_max = mTickSpacing; while(max > cur_max && mMaxBar > cur_max) @@ -352,7 +347,7 @@ void LLStatBar::draw() for (i = 1; i <= max_frame; i++) { F32 offset = ((F32)i / (F32)mNumFrames) * span; - LLTrace::Recording& recording = frame_recording.getPrevRecordingPeriod(i); + LLTrace::Recording& recording = frame_recording.getPrevRecording(i); if (mPerSec) { if (mCountFloatp) diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp index bdb378c9c5..af01e66095 100644 --- a/indra/llui/llstatgraph.cpp +++ b/indra/llui/llstatgraph.cpp @@ -66,7 +66,7 @@ void LLStatGraph::draw() range = mMax - mMin; if (mNewStatFloatp) { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); if (mPerSec) { @@ -79,7 +79,7 @@ void LLStatGraph::draw() } else if (mNewStatIntp) { - LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecordingPeriod(); + LLTrace::Recording& recording = LLTrace::get_frame_recording().getLastRecording(); if (mPerSec) { -- cgit v1.2.3 From bdc6d58b7e84bc81977148995b0028f7420eee65 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 11 Apr 2013 19:12:27 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics added ability to query periodic timer for specific number of periods used that to do smaller time averaged window for camera speed --- indra/llui/llstatbar.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 46eea368e5..70ba59b130 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -112,16 +112,16 @@ void LLStatBar::draw() if (mPerSec) { current = last_frame_recording.getPerSec(*mCountFloatp); - min = frame_recording.getPeriodMinPerSec(*mCountFloatp); - max = frame_recording.getPeriodMaxPerSec(*mCountFloatp); - mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp); + min = frame_recording.getPeriodMinPerSec(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMaxPerSec(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMeanPerSec(*mCountFloatp, mNumFrames); } else { current = last_frame_recording.getSum(*mCountFloatp); - min = frame_recording.getPeriodMin(*mCountFloatp); - max = frame_recording.getPeriodMax(*mCountFloatp); - mean = frame_recording.getPeriodMean(*mCountFloatp); + min = frame_recording.getPeriodMin(*mCountFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mCountFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mCountFloatp, mNumFrames); } } else if (mCountIntp) @@ -131,16 +131,16 @@ void LLStatBar::draw() if (mPerSec) { current = last_frame_recording.getPerSec(*mCountIntp); - min = frame_recording.getPeriodMinPerSec(*mCountIntp); - max = frame_recording.getPeriodMaxPerSec(*mCountIntp); - mean = frame_recording.getPeriodMeanPerSec(*mCountIntp); + min = frame_recording.getPeriodMinPerSec(*mCountIntp, mNumFrames); + max = frame_recording.getPeriodMaxPerSec(*mCountIntp, mNumFrames); + mean = frame_recording.getPeriodMeanPerSec(*mCountIntp, mNumFrames); } else { current = last_frame_recording.getSum(*mCountIntp); - min = frame_recording.getPeriodMin(*mCountIntp); - max = frame_recording.getPeriodMax(*mCountIntp); - mean = frame_recording.getPeriodMean(*mCountIntp); + min = frame_recording.getPeriodMin(*mCountIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mCountIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mCountIntp, mNumFrames); } } else if (mMeasurementFloatp) @@ -148,18 +148,18 @@ void LLStatBar::draw() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getLastValue(*mMeasurementFloatp); - min = frame_recording.getPeriodMin(*mMeasurementFloatp); - max = frame_recording.getPeriodMax(*mMeasurementFloatp); - mean = frame_recording.getPeriodMean(*mMeasurementFloatp); + min = frame_recording.getPeriodMin(*mMeasurementFloatp, mNumFrames); + max = frame_recording.getPeriodMax(*mMeasurementFloatp, mNumFrames); + mean = frame_recording.getPeriodMean(*mMeasurementFloatp, mNumFrames); } else if (mMeasurementIntp) { LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); current = last_frame_recording.getLastValue(*mMeasurementIntp); - min = frame_recording.getPeriodMin(*mMeasurementIntp); - max = frame_recording.getPeriodMax(*mMeasurementIntp); - mean = frame_recording.getPeriodMean(*mMeasurementIntp); + min = frame_recording.getPeriodMin(*mMeasurementIntp, mNumFrames); + max = frame_recording.getPeriodMax(*mMeasurementIntp, mNumFrames); + mean = frame_recording.getPeriodMean(*mMeasurementIntp, mNumFrames); } current *= mUnitScale; -- cgit v1.2.3