diff options
author | Richard Linden <none@none> | 2013-05-31 16:59:00 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-05-31 16:59:00 -0700 |
commit | 72641a933500f1b1156bd3006c6a227e7fa3567c (patch) | |
tree | 5921e697f526fbba46daa4e971c167087c37fea6 /indra/newview | |
parent | f6c5a4057d1154e590ee630cb8254879a1f426e4 (diff) | |
parent | 9def3590f41dee3cba7760e4443fdc71f5fb2db6 (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-interesting/
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llscenemonitor.cpp | 32 | ||||
-rw-r--r-- | indra/newview/llscenemonitor.h | 9 |
3 files changed, 18 insertions, 28 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ff481d6278..451ea76a02 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1578,10 +1578,7 @@ bool LLAppViewer::cleanup() LLEventPumps::instance().reset(); //dump scene loading monitor results - if(LLSceneMonitor::instance().hasResults()) - { - LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv")); - } + LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv")); if (LLFastTimerView::sAnalyzePerformance) { diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index a28c2eac20..7eb48eb575 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -67,22 +67,13 @@ LLSceneMonitor::LLSceneMonitor() : { mFrames[0] = NULL; mFrames[1] = NULL; - - mRecording = new LLTrace::ExtendablePeriodicRecording(); } LLSceneMonitor::~LLSceneMonitor() { mDiffState = VIEWER_QUITTING; - destroyClass(); -} - -void LLSceneMonitor::destroyClass() -{ reset(); - delete mRecording; - mRecording = NULL; mDitheringTexture = NULL; } @@ -96,7 +87,8 @@ void LLSceneMonitor::reset() mFrames[1] = NULL; mDiff = NULL; - mRecording->reset(); + mMonitorRecording.reset(); + mSceneLoadRecording.reset(); unfreezeScene(); @@ -269,10 +261,9 @@ void LLSceneMonitor::capture() static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime"); static LLFrameTimer timer; - LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording(); if (mEnabled - && (last_frame_recording.getSum(*LLViewerCamera::getVelocityStat()) > 0.001f - || last_frame_recording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.01f)) + && (mMonitorRecording.getSum(*LLViewerCamera::getVelocityStat()) > 0.1f + || mMonitorRecording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.05f)) { reset(); freezeScene(); @@ -299,7 +290,8 @@ void LLSceneMonitor::capture() && LLGLSLShader::sNoFixedFunction && last_capture_time != gFrameCount) { - mRecording->resume(); + mSceneLoadRecording.resume(); + mMonitorRecording.resume(); timer.reset(); @@ -486,13 +478,13 @@ void LLSceneMonitor::fetchQueryResult() static LLCachedControl<F32> diff_threshold(gSavedSettings,"SceneLoadingPixelDiffThreshold"); if(mDiffResult > diff_threshold()) { - mRecording->extend(); - llassert(mRecording->getAcceptedRecording().getLastRecording().getSum(LLStatViewer::FPS)); + mSceneLoadRecording.extend(); + llassert(mSceneLoadRecording.getAcceptedRecording().getLastRecording().getSum(LLStatViewer::FPS)); } else { - mRecording->getPotentialRecording().nextPeriod(); - llassert(mRecording->getPotentialRecording().getLastRecording().getSum(LLStatViewer::FPS)); + mSceneLoadRecording.getPotentialRecording().nextPeriod(); + llassert(mSceneLoadRecording.getPotentialRecording().getLastRecording().getSum(LLStatViewer::FPS)); } } } @@ -501,13 +493,15 @@ void LLSceneMonitor::fetchQueryResult() //dump results to a file _scene_xmonitor_results.csv void LLSceneMonitor::dumpToFile(std::string file_name) { + if (!hasResults()) return; + LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL; std::ofstream os(file_name.c_str()); os << std::setprecision(4); - LLTrace::PeriodicRecording& scene_load_recording = mRecording->getAcceptedRecording(); + LLTrace::PeriodicRecording& scene_load_recording = mSceneLoadRecording.getAcceptedRecording(); U32 frame_count = scene_load_recording.getNumPeriods(); LLUnit<LLUnits::Seconds, F64> frame_time; diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h index 3351ed0579..6af58b707a 100644 --- a/indra/newview/llscenemonitor.h +++ b/indra/newview/llscenemonitor.h @@ -44,8 +44,6 @@ public: LLSceneMonitor(); ~LLSceneMonitor(); - void destroyClass(); - void freezeAvatar(LLCharacter* avatarp); void setDebugViewerVisible(bool visible); @@ -62,9 +60,9 @@ public: bool isEnabled()const {return mEnabled;} bool needsUpdate() const; - LLTrace::ExtendablePeriodicRecording* getRecording() const {return mRecording;} + const LLTrace::ExtendablePeriodicRecording* getRecording() const {return &mSceneLoadRecording;} void dumpToFile(std::string file_name); - bool hasResults() const { return mRecording->getAcceptedRecording().getDuration() != 0;} + bool hasResults() const { return mSceneLoadRecording.getAcceptedRecording().getDuration() != 0;} private: void freezeScene(); @@ -103,7 +101,8 @@ private: std::vector<LLAnimPauseRequest> mAvatarPauseHandles; - LLTrace::ExtendablePeriodicRecording* mRecording; + LLTrace::ExtendablePeriodicRecording mSceneLoadRecording; + LLTrace::Recording mMonitorRecording; }; class LLSceneMonitorView : public LLFloater |