diff options
author | Oz Linden <oz@lindenlab.com> | 2016-01-15 16:55:04 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-01-15 16:55:04 -0500 |
commit | bc22e587439a2822e5228508e7a4a1e2ec0121c5 (patch) | |
tree | 442540d0c2760617a2c0cf0cb9ba1973ab6fb298 /indra/newview/lltextureinfo.cpp | |
parent | 317644f5d575ecd4e734c9a5327f2a062ebf914a (diff) | |
parent | 5a5c023e291990a463b1a91846ce82c70da8daab (diff) |
merge changes for 4.0.1-release
Diffstat (limited to 'indra/newview/lltextureinfo.cpp')
-rw-r--r-- | indra/newview/lltextureinfo.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index 59d692b287..473d8ce709 100644 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -36,14 +36,16 @@ static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloa static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); -LLTextureInfo::LLTextureInfo() : +LLTextureInfo::LLTextureInfo(bool postponeStartRecoreder) : mLogTextureDownloadsToViewerLog(false), mLogTextureDownloadsToSimulator(false), mTextureDownloadProtocol("NONE"), mTextureLogThreshold(LLUnits::Kilobytes::fromValue(100)) { - mTextures.clear(); - mRecording.start(); + if (!postponeStartRecoreder) + { + startRecording(); + } } void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold) @@ -78,15 +80,7 @@ U32 LLTextureInfo::getTextureInfoMapSize() bool LLTextureInfo::has(const LLUUID& id) { - std::map<LLUUID, LLTextureInfoDetails *>::iterator iterator = mTextures.find(id); - if (iterator == mTextures.end()) - { - return false; - } - else - { - return true; - } + return mTextures.end() != mTextures.find(id); } void LLTextureInfo::setRequestStartTime(const LLUUID& id, U64 startTime) @@ -192,15 +186,12 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon LLSD LLTextureInfo::getAverages() { LLSD averagedTextureData; - S32 averageDownloadRate; - U32Milliseconds download_time = mRecording.getSum(sTexureDownloadTime); - if(download_time == (U32Milliseconds)0) - { - averageDownloadRate = 0; - } - else + S32 averageDownloadRate = 0; + unsigned int download_time = mRecording.getSum(sTexureDownloadTime).valueInUnits<LLUnits::Seconds>(); + + if (0 != download_time) { - averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time.valueInUnits<LLUnits::Seconds>(); + averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueInUnits<LLUnits::Bits>() / download_time; } averagedTextureData["bits_per_second"] = averageDownloadRate; @@ -212,6 +203,16 @@ LLSD LLTextureInfo::getAverages() return averagedTextureData; } +void LLTextureInfo::startRecording() +{ + mRecording.start(); +} + +void LLTextureInfo::stopRecording() +{ + mRecording.stop(); +} + void LLTextureInfo::resetTextureStatistics() { mRecording.restart(); |