diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-03-25 21:25:06 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-03-25 21:25:06 -0600 |
commit | aad93f4e52a745892612dee89ba72935e49dd099 (patch) | |
tree | 6d1ad19c072bec42972f24f803368f1f930f44ea /indra/newview/llscenemonitor.cpp | |
parent | 935dce7d6b0a343cef5b13f53d6da5d0c2dc6a73 (diff) | |
parent | 268ea2902d1108a1b30909340ca10ee0bea9f147 (diff) |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-interesting-metrics
Diffstat (limited to 'indra/newview/llscenemonitor.cpp')
-rw-r--r-- | indra/newview/llscenemonitor.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index c69f276aa2..5cde573855 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -486,11 +486,46 @@ void LLSceneMonitor::fetchQueryResult() if(mDiffResult > 0.01f) { - mRecording->extend(); - sample(sFramePixelDiff, mDiffResult); + addMonitorResult(); } - //llinfos << count << " : " << mDiffResult << llendl; } + +void LLSceneMonitor::addMonitorResult() +{ + mRecording->extend(); + sample(sFramePixelDiff, mDiffResult); + + ll_monitor_result_t result; + result.mTimeStamp = LLImageGL::sLastFrameTime; + result.mDiff = mDiffResult; + mMonitorResults.push_back(result); +} + +//dump results to a file _scene_monitor_results.csv +void LLSceneMonitor::dumpToFile(std::string file_name) +{ + if(mMonitorResults.empty()) + { + return; //nothing to dump + } + + std::ofstream os(file_name.c_str()); + + //total scene loading time + os << llformat("Scene Loading time: %.4f seconds\n", (F32)getRecording()->getAcceptedRecording().getDuration().value()); + + S32 num_results = mMonitorResults.size(); + for(S32 i = 0; i < num_results; i++) + { + os << llformat("%.4f %.4f\n", mMonitorResults[i].mTimeStamp, mMonitorResults[i].mDiff); + } + + os.flush(); + os.close(); + + mMonitorResults.clear(); +} + //------------------------------------------------------------------------------------------------------------- //definition of class LLSceneMonitorView //------------------------------------------------------------------------------------------------------------- @@ -511,6 +546,7 @@ void LLSceneMonitorView::onClickCloseBtn() void LLSceneMonitorView::setVisible(BOOL visible) { + visible = visible && LLGLSLShader::sNoFixedFunction; LLSceneMonitor::getInstance()->setDebugViewerVisible(visible); LLView::setVisible(visible); |