summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llappviewer.cpp4
-rwxr-xr-xindra/newview/llclassifiedstatsresponder.cpp17
-rwxr-xr-xindra/newview/llfasttimerview.cpp20
-rw-r--r--indra/newview/llscenemonitor.cpp28
-rwxr-xr-xindra/newview/llstartup.cpp54
-rwxr-xr-xindra/newview/lltexturefetch.cpp132
-rwxr-xr-xindra/newview/lltextureinfo.cpp80
-rwxr-xr-xindra/newview/lltextureinfo.h32
-rwxr-xr-xindra/newview/lltextureinfodetails.cpp4
-rwxr-xr-xindra/newview/lltextureinfodetails.h14
-rwxr-xr-xindra/newview/lltexturestats.cpp3
-rwxr-xr-xindra/newview/lltexturestatsuploader.cpp8
-rwxr-xr-xindra/newview/lltexturestatsuploader.h4
-rwxr-xr-xindra/newview/llviewerassetstats.cpp15
-rwxr-xr-xindra/newview/llviewercamera.cpp2
-rwxr-xr-xindra/newview/llviewerdisplay.cpp15
-rwxr-xr-xindra/newview/llviewerstats.cpp10
-rwxr-xr-xindra/newview/llvocache.h1
-rwxr-xr-xindra/newview/tests/llviewerassetstats_test.cpp6
19 files changed, 222 insertions, 227 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 733c9cc9df..e77f793a43 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1297,7 +1297,7 @@ bool LLAppViewer::mainLoop()
LLTrace::get_frame_recording().nextPeriod();
LLTrace::TimeBlock::logStats();
- LLTrace::getUIThreadRecorder().pullFromSlaveThreads();
+ LLTrace::get_master_thread_recorder()->pullFromChildren();
//clear call stack records
llclearcallstacks;
@@ -5617,6 +5617,6 @@ void LLAppViewer::metricsSend(bool enable_reporting)
// Reset even if we can't report. Rather than gather up a huge chunk of
// data, we'll keep to our sampling interval and retain the data
// resolution in time.
- gViewerAssetStats->reset();
+ gViewerAssetStats->restart();
}
diff --git a/indra/newview/llclassifiedstatsresponder.cpp b/indra/newview/llclassifiedstatsresponder.cpp
index e3cd83e174..1e1c9039fb 100755
--- a/indra/newview/llclassifiedstatsresponder.cpp
+++ b/indra/newview/llclassifiedstatsresponder.cpp
@@ -38,10 +38,8 @@
#include "message.h"
LLClassifiedStatsResponder::LLClassifiedStatsResponder(LLUUID classified_id)
-:
-mClassifiedID(classified_id)
-{
-}
+: mClassifiedID(classified_id)
+{}
/*virtual*/
void LLClassifiedStatsResponder::result(const LLSD& content)
@@ -53,12 +51,11 @@ void LLClassifiedStatsResponder::result(const LLSD& content)
S32 search_map = content["search_map_clicks"].asInteger();
S32 search_profile = content["search_profile_clicks"].asInteger();
- LLPanelClassifiedInfo::setClickThrough(
- mClassifiedID,
- teleport + search_teleport,
- map + search_map,
- profile + search_profile,
- true);
+ LLPanelClassifiedInfo::setClickThrough( mClassifiedID,
+ teleport + search_teleport,
+ map + search_map,
+ profile + search_profile,
+ true);
}
/*virtual*/
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index d3a97fde0e..d922659435 100755
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -430,18 +430,18 @@ void LLFastTimerView::draw()
}
void LLFastTimerView::onOpen(const LLSD& key)
- {
+{
setPauseState(false);
mRecording.reset();
mRecording.appendPeriodicRecording(LLTrace::get_frame_recording());
for(std::deque<TimerBarRow>::iterator it = mTimerBarRows.begin(), end_it = mTimerBarRows.end();
it != end_it;
- ++it)
- {
+ ++it)
+ {
delete []it->mBars;
it->mBars = NULL;
- }
- }
+ }
+}
void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch)
@@ -1101,7 +1101,7 @@ void LLFastTimerView::drawLineGraph()
j--)
{
LLTrace::Recording& recording = mRecording.getPrevRecording(j);
- LLUnit<F32, LLUnits::Seconds> time = llmax(recording.getSum(*idp), LLUnit<F64, LLUnits::Seconds>(0.000001));
+ LLUnit<F32, LLUnits::Seconds> time = llmax(recording.getSum(*idp), LLUnits::Seconds::fromValue(0.000001));
U32 calls = recording.getSum(idp->callCount());
if (is_hover_timer)
@@ -1126,7 +1126,7 @@ void LLFastTimerView::drawLineGraph()
}
gGL.vertex2f(x,y);
gGL.vertex2f(x,mGraphRect.mBottom);
-}
+ }
gGL.end();
if (mHoverID == idp)
@@ -1146,7 +1146,7 @@ void LLFastTimerView::drawLineGraph()
max_time = lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f));
if (llabs((max_time - cur_max).value()) <= 1)
{
- max_time = llmax(LLUnit<F32, LLUnits::Microseconds>(1), LLUnit<F32, LLUnits::Microseconds>(cur_max));
+ max_time = llmax(LLUnits::Microseconds::fromValue(1.f), LLUnits::Microseconds::fromValue(cur_max));
}
max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f)));
@@ -1423,11 +1423,11 @@ void LLFastTimerView::updateTotalTime()
mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME, 20);
break;
default:
- mTotalTimeDisplay = LLUnit<F32, LLUnits::Milliseconds>(100);
+ mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(100);
break;
}
- mTotalTimeDisplay = LLUnit<F32, LLUnits::Milliseconds>(llceil(mTotalTimeDisplay.getAs<LLUnits::Milliseconds>() / 20.f) * 20.f);
+ mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil(mTotalTimeDisplay.valueAs<LLUnits::Milliseconds>() / 20.f) * 20.f);
}
void LLFastTimerView::drawBars()
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
index ed9eeb9330..342b45863a 100644
--- a/indra/newview/llscenemonitor.cpp
+++ b/indra/newview/llscenemonitor.cpp
@@ -260,14 +260,7 @@ void LLSceneMonitor::capture()
static LLCachedControl<bool> monitor_enabled(gSavedSettings, "SceneLoadingMonitorEnabled");
static LLCachedControl<F32> scene_load_sample_time(gSavedSettings, "SceneLoadingMonitorSampleTime");
static LLFrameTimer timer;
-
- if (mEnabled
- && (mMonitorRecording.getSum(*LLViewerCamera::getVelocityStat()) > 0.1f
- || mMonitorRecording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.05f))
- {
- reset();
- freezeScene();
- }
+ static bool force_capture = true;
bool enabled = monitor_enabled || mDebugViewerVisible;
if(mEnabled != enabled)
@@ -275,6 +268,7 @@ void LLSceneMonitor::capture()
if(mEnabled)
{
unfreezeScene();
+ force_capture = true;
}
else
{
@@ -285,11 +279,23 @@ void LLSceneMonitor::capture()
mEnabled = enabled;
}
- if(timer.getElapsedTimeF32() > scene_load_sample_time()
+ if (mEnabled
+ && (mMonitorRecording.getSum(*LLViewerCamera::getVelocityStat()) > 0.1f
+ || mMonitorRecording.getSum(*LLViewerCamera::getAngularVelocityStat()) > 0.05f))
+ {
+ reset();
+ freezeScene();
+ force_capture = true;
+ }
+
+ if((timer.getElapsedTimeF32() > scene_load_sample_time()
+ || force_capture)
&& mEnabled
&& LLGLSLShader::sNoFixedFunction
&& last_capture_time != gFrameCount)
{
+ force_capture = false;
+
mSceneLoadRecording.resume();
mMonitorRecording.resume();
@@ -479,12 +485,10 @@ void LLSceneMonitor::fetchQueryResult()
if(mDiffResult > diff_threshold())
{
mSceneLoadRecording.extend();
- llassert(mSceneLoadRecording.getAcceptedRecording().getLastRecording().getSum(LLStatViewer::FPS));
}
else
{
mSceneLoadRecording.getPotentialRecording().nextPeriod();
- llassert(mSceneLoadRecording.getPotentialRecording().getLastRecording().getSum(LLStatViewer::FPS));
}
}
}
@@ -620,7 +624,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
for (S32 frame = 1; frame <= frame_count; frame++)
{
- os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).getAs<LLUnits::Kibibytes>();
+ os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).valueAs<LLUnits::Kibibytes>();
}
os << '\n';
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index de8d549055..097ea7cc8d 100755
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2054,6 +2054,7 @@ bool idle_startup()
const F32 wearables_time = wearables_timer.getElapsedTimeF32();
static LLCachedControl<F32> max_wearables_time(gSavedSettings, "ClothingLoadingDelay");
+ display_startup();
if (!gAgent.isGenderChosen() && isAgentAvatarValid())
{
// No point in waiting for clothing, we don't even
@@ -2067,50 +2068,39 @@ bool idle_startup()
LLNotificationsUtil::add("WelcomeChooseSex", LLSD(), LLSD(),
callback_choose_gender);
LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
}
-
- display_startup();
-
- if (wearables_time > max_wearables_time())
+ else if (wearables_time >= max_wearables_time())
{
LLNotificationsUtil::add("ClothingLoading");
record(LLStatViewer::LOADING_WEARABLES_LONG_DELAY, wearables_time);
LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
}
-
- if (gAgent.isFirstLogin())
+ else if (gAgent.isFirstLogin()
+ && isAgentAvatarValid()
+ && gAgentAvatarp->isFullyLoaded())
{
// wait for avatar to be completely loaded
- if (isAgentAvatarValid()
- && gAgentAvatarp->isFullyLoaded())
- {
- //llinfos << "avatar fully loaded" << llendl;
- LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
- }
+ //llinfos << "avatar fully loaded" << llendl;
+ LLStartUp::setStartupState( STATE_CLEANUP );
+ }
+ // OK to just get the wearables
+ else if (!gAgent.isFirstLogin() && gAgentWearables.areWearablesLoaded() )
+ {
+ // We have our clothing, proceed.
+ //llinfos << "wearables loaded" << llendl;
+ LLStartUp::setStartupState( STATE_CLEANUP );
}
else
{
- // OK to just get the wearables
- if ( gAgentWearables.areWearablesLoaded() )
- {
- // We have our clothing, proceed.
- //llinfos << "wearables loaded" << llendl;
- LLStartUp::setStartupState( STATE_CLEANUP );
- return TRUE;
- }
+ display_startup();
+ update_texture_fetch();
+ display_startup();
+ set_startup_status(0.9f + 0.1f * wearables_time / max_wearables_time(),
+ LLTrans::getString("LoginDownloadingClothing").c_str(),
+ gAgent.mMOTD.c_str());
+ display_startup();
}
-
- display_startup();
- update_texture_fetch();
- display_startup();
- set_startup_status(0.9f + 0.1f * wearables_time / max_wearables_time(),
- LLTrans::getString("LoginDownloadingClothing").c_str(),
- gAgent.mMOTD.c_str());
- display_startup();
- return TRUE;
+ //fall through this frame to STATE_CLEANUP
}
if (STATE_CLEANUP == LLStartUp::getStartupState())
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 4b9a950b98..0390649a1c 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -504,81 +504,85 @@ private:
static const char* sStateDescs[];
e_state mState;
void setState(e_state new_state);
- e_write_to_cache_state mWriteToCacheState;
- LLTextureFetch* mFetcher;
+
+ e_write_to_cache_state mWriteToCacheState;
+ LLTextureFetch* mFetcher;
LLPointer<LLImageFormatted> mFormattedImage;
- LLPointer<LLImageRaw> mRawImage;
- LLPointer<LLImageRaw> mAuxImage;
- FTType mFTType;
- LLUUID mID;
- LLHost mHost;
- std::string mUrl;
- U8 mType;
- F32 mImagePriority;
- U32 mWorkPriority;
- F32 mRequestedPriority;
- S32 mDesiredDiscard;
- S32 mSimRequestedDiscard;
- S32 mRequestedDiscard;
- S32 mLoadedDiscard;
- S32 mDecodedDiscard;
- LLFrameTimer mRequestedTimer;
- LLFrameTimer mFetchTimer;
- LLTimer mCacheReadTimer;
- F32 mCacheReadTime;
- LLTextureCache::handle_t mCacheReadHandle;
- LLTextureCache::handle_t mCacheWriteHandle;
- S32 mRequestedSize;
- S32 mRequestedOffset;
- S32 mDesiredSize;
- S32 mFileSize;
- S32 mCachedSize;
- e_request_state mSentRequest;
- handle_t mDecodeHandle;
- BOOL mLoaded;
- BOOL mDecoded;
- BOOL mWritten;
- BOOL mNeedsAux;
- BOOL mHaveAllData;
- BOOL mInLocalCache;
- BOOL mInCache;
- bool mCanUseHTTP ;
- bool mCanUseNET ; //can get from asset server.
- S32 mRetryAttempt;
- S32 mActiveCount;
- LLCore::HttpStatus mGetStatus;
- std::string mGetReason;
+ LLPointer<LLImageRaw> mRawImage,
+ mAuxImage;
+ FTType mFTType;
+ LLUUID mID;
+ LLHost mHost;
+ std::string mUrl;
+ U8 mType;
+ F32 mImagePriority;
+ U32 mWorkPriority;
+ F32 mRequestedPriority;
+ S32 mDesiredDiscard,
+ mSimRequestedDiscard,
+ mRequestedDiscard,
+ mLoadedDiscard,
+ mDecodedDiscard;
+ LLFrameTimer mRequestedTimer,
+ mFetchTimer;
+ LLTimer mCacheReadTimer;
+ F32 mCacheReadTime;
+ LLTextureCache::handle_t mCacheReadHandle,
+ mCacheWriteHandle;
+ S32 mRequestedSize,
+ mRequestedOffset,
+ mDesiredSize,
+ mFileSize,
+ mCachedSize;
+ e_request_state mSentRequest;
+ handle_t mDecodeHandle;
+ BOOL mLoaded;
+ BOOL mDecoded;
+ BOOL mWritten;
+ BOOL mNeedsAux;
+ BOOL mHaveAllData;
+ BOOL mInLocalCache;
+ BOOL mInCache;
+ bool mCanUseHTTP,
+ mCanUseNET ; //can get from asset server.
+ S32 mRetryAttempt;
+ S32 mActiveCount;
+ LLCore::HttpStatus mGetStatus;
+ std::string mGetReason;
// Work Data
- LLMutex mWorkMutex;
+ LLMutex mWorkMutex;
struct PacketData
{
- PacketData(U8* data, S32 size) { mData = data; mSize = size; }
+ PacketData(U8* data, S32 size)
+ : mData(data), mSize(size)
+ {}
~PacketData() { clearData(); }
void clearData() { delete[] mData; mData = NULL; }
- U8* mData;
- U32 mSize;
+
+ U8* mData;
+ U32 mSize;
};
- std::vector<PacketData*> mPackets;
- S32 mFirstPacket;
- S32 mLastPacket;
- U16 mTotalPackets;
- U8 mImageCodec;
+ std::vector<PacketData*> mPackets;
+ S32 mFirstPacket;
+ S32 mLastPacket;
+ U16 mTotalPackets;
+ U8 mImageCodec;
LLViewerAssetStats::duration_t mMetricsStartTime;
- LLCore::HttpHandle mHttpHandle; // Handle of any active request
- LLCore::BufferArray * mHttpBufferArray; // Refcounted pointer to response data
- int mHttpPolicyClass;
- bool mHttpActive; // Active request to http library
- unsigned int mHttpReplySize; // Actual received data size
- unsigned int mHttpReplyOffset; // Actual received data offset
- bool mHttpHasResource; // Counts against Fetcher's mHttpSemaphore
+ LLCore::HttpHandle mHttpHandle; // Handle of any active request
+ LLCore::BufferArray * mHttpBufferArray; // Refcounted pointer to response data
+ S32 mHttpPolicyClass;
+ bool mHttpActive; // Active request to http library
+ U32 mHttpReplySize, // Actual received data size
+ mHttpReplyOffset; // Actual received data offset
+ bool mHttpHasResource; // Counts against Fetcher's mHttpSemaphore
// State history
- U32 mCacheReadCount;
- U32 mCacheWriteCount;
- U32 mResourceWaitCount; // Requests entering WAIT_HTTP_RESOURCE2
+ U32 mCacheReadCount,
+ mCacheWriteCount,
+ mResourceWaitCount; // Requests entering WAIT_HTTP_RESOURCE2
};
//////////////////////////////////////////////////////////////////////////////
@@ -2390,7 +2394,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
mFetcherLocked(FALSE)
{
mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS");
- mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold"));
+ mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), LLUnits::Bytes::fromValue(gSavedSettings.getU32("TextureLoggingThreshold")));
LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled");
if(LLTextureFetchDebugger::isEnabled())
@@ -3369,7 +3373,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1
if (log_to_viewer_log || log_to_sim)
{
- U64 timeNow = LLTimer::getTotalTime();
+ LLUnit<U64, LLUnits::Microseconds> timeNow = LLTimer::getTotalTime();
mTextureInfo.setRequestSize(id, worker->mFileSize);
mTextureInfo.setRequestCompleteTimeAndLog(id, timeNow);
}
diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp
index adfdbc997e..3ae85d56da 100755
--- a/indra/newview/lltextureinfo.cpp
+++ b/indra/newview/lltextureinfo.cpp
@@ -29,26 +29,28 @@
#include "lltextureinfo.h"
#include "lltexturestats.h"
#include "llviewercontrol.h"
+#include "lltrace.h"
+
+static LLTrace::CountStatHandle<S32> sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated");
+static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed");
+static LLTrace::CountStatHandle<LLUnit<S32, LLUnits::Bytes> > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded");
+static LLTrace::CountStatHandle<LLUnit<U32, LLUnits::Milliseconds> > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures");
LLTextureInfo::LLTextureInfo() :
mLogTextureDownloadsToViewerLog(false),
mLogTextureDownloadsToSimulator(false),
- mTotalBytes(0),
- mTotalMilliseconds(0),
- mTextureDownloadsStarted(0),
- mTextureDownloadsCompleted(0),
mTextureDownloadProtocol("NONE"),
- mTextureLogThreshold(100 * 1024),
- mCurrentStatsBundleStartTime(0)
+ mTextureLogThreshold(LLUnits::Kibibytes::fromValue(100))
{
mTextures.clear();
+ mRecording.start();
}
-void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32 textureLogThreshold)
+void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold)
{
mLogTextureDownloadsToViewerLog = writeToViewerLog;
mLogTextureDownloadsToSimulator = sendToSim;
- mTextureLogThreshold = textureLogThreshold;
+ mTextureLogThreshold = LLUnit<U32, LLUnits::Bytes>(textureLogThreshold);
}
LLTextureInfo::~LLTextureInfo()
@@ -94,7 +96,7 @@ void LLTextureInfo::setRequestStartTime(const LLUUID& id, U64 startTime)
addRequest(id);
}
mTextures[id]->mStartTime = startTime;
- mTextureDownloadsStarted++;
+ add(sTextureDownloadsStarted, 1);
}
void LLTextureInfo::setRequestSize(const LLUUID& id, U32 size)
@@ -124,16 +126,19 @@ void LLTextureInfo::setRequestType(const LLUUID& id, LLTextureInfoDetails::LLReq
mTextures[id]->mType = type;
}
-void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime)
+void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime)
{
if (!has(id))
{
addRequest(id);
}
- mTextures[id]->mCompleteTime = completeTime;
+
+ LLTextureInfoDetails& details = *mTextures[id];
+
+ details.mCompleteTime = completeTime;
std::string protocol = "NONE";
- switch(mTextures[id]->mType)
+ switch(details.mType)
{
case LLTextureInfoDetails::REQUEST_TYPE_HTTP:
protocol = "HTTP";
@@ -150,24 +155,23 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeT
if (mLogTextureDownloadsToViewerLog)
{
- llinfos << "texture=" << id
- << " start=" << mTextures[id]->mStartTime
- << " end=" << mTextures[id]->mCompleteTime
- << " size=" << mTextures[id]->mSize
- << " offset=" << mTextures[id]->mOffset
- << " length_in_ms=" << (mTextures[id]->mCompleteTime - mTextures[id]->mStartTime) / 1000
- << " protocol=" << protocol
- << llendl;
+ llinfos << "texture=" << id
+ << " start=" << details.mStartTime
+ << " end=" << details.mCompleteTime
+ << " size=" << details.mSize
+ << " offset=" << details.mOffset
+ << " length=" << LLUnit<U32, LLUnits::Milliseconds>(details.mCompleteTime - details.mStartTime)
+ << " protocol=" << protocol
+ << llendl;
}
if(mLogTextureDownloadsToSimulator)
{
- S32 texture_stats_upload_threshold = mTextureLogThreshold;
- mTotalBytes += mTextures[id]->mSize;
- mTotalMilliseconds += mTextures[id]->mCompleteTime - mTextures[id]->mStartTime;
- mTextureDownloadsCompleted++;
+ add(sTextureDataDownloaded, details.mSize);
+ add(sTexureDownloadTime, details.mCompleteTime - details.mStartTime);
+ add(sTextureDownloadsCompleted, 1);
mTextureDownloadProtocol = protocol;
- if (mTotalBytes >= texture_stats_upload_threshold)
+ if (mRecording.getSum(sTextureDataDownloaded) >= mTextureLogThreshold)
{
LLSD texture_data;
std::stringstream startTime;
@@ -189,35 +193,33 @@ LLSD LLTextureInfo::getAverages()
{
LLSD averagedTextureData;
S32 averageDownloadRate;
- if(mTotalMilliseconds == 0)
+ LLUnit<U32, LLUnits::Milliseconds> download_time = mRecording.getSum(sTexureDownloadTime);
+ if(download_time == 0)
{
averageDownloadRate = 0;
}
else
{
- averageDownloadRate = (mTotalBytes * 8) / mTotalMilliseconds;
+ averageDownloadRate = mRecording.getSum(sTextureDataDownloaded).valueAs<LLUnits::Bits>() / download_time.valueAs<LLUnits::Seconds>();
}
- averagedTextureData["bits_per_second"] = averageDownloadRate;
- averagedTextureData["bytes_downloaded"] = mTotalBytes;
- averagedTextureData["texture_downloads_started"] = mTextureDownloadsStarted;
- averagedTextureData["texture_downloads_completed"] = mTextureDownloadsCompleted;
- averagedTextureData["transport"] = mTextureDownloadProtocol;
+ averagedTextureData["bits_per_second"] = averageDownloadRate;
+ averagedTextureData["bytes_downloaded"] = mRecording.getSum(sTextureDataDownloaded).valueAs<LLUnits::Bytes>();
+ averagedTextureData["texture_downloads_started"] = mRecording.getSum(sTextureDownloadsStarted);
+ averagedTextureData["texture_downloads_completed"] = mRecording.getSum(sTextureDownloadsCompleted);
+ averagedTextureData["transport"] = mTextureDownloadProtocol;
return averagedTextureData;
}
void LLTextureInfo::resetTextureStatistics()
{
- mTotalMilliseconds = 0;
- mTotalBytes = 0;
- mTextureDownloadsStarted = 0;
- mTextureDownloadsCompleted = 0;
+ mRecording.restart();
mTextureDownloadProtocol = "NONE";
mCurrentStatsBundleStartTime = LLTimer::getTotalTime();
}
-U32 LLTextureInfo::getRequestStartTime(const LLUUID& id)
+LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestStartTime(const LLUUID& id)
{
if (!has(id))
{
@@ -230,7 +232,7 @@ U32 LLTextureInfo::getRequestStartTime(const LLUUID& id)
}
}
-U32 LLTextureInfo::getRequestSize(const LLUUID& id)
+LLUnit<U32, LLUnits::Bytes> LLTextureInfo::getRequestSize(const LLUUID& id)
{
if (!has(id))
{
@@ -269,7 +271,7 @@ LLTextureInfoDetails::LLRequestType LLTextureInfo::getRequestType(const LLUUID&
}
}
-U32 LLTextureInfo::getRequestCompleteTime(const LLUUID& id)
+LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestCompleteTime(const LLUUID& id)
{
if (!has(id))
{
diff --git a/indra/newview/lltextureinfo.h b/indra/newview/lltextureinfo.h
index 2ccbcc5fd2..a861a12668 100755
--- a/indra/newview/lltextureinfo.h
+++ b/indra/newview/lltextureinfo.h
@@ -29,6 +29,7 @@
#include "lluuid.h"
#include "lltextureinfodetails.h"
+#include "lltracerecording.h"
#include <map>
class LLTextureInfo
@@ -37,18 +38,18 @@ public:
LLTextureInfo();
~LLTextureInfo();
- void setUpLogging(bool writeToViewerLog, bool sendToSim, U32 textureLogThreshold);
+ void setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold);
bool has(const LLUUID& id);
void setRequestStartTime(const LLUUID& id, U64 startTime);
void setRequestSize(const LLUUID& id, U32 size);
void setRequestOffset(const LLUUID& id, U32 offset);
void setRequestType(const LLUUID& id, LLTextureInfoDetails::LLRequestType type);
- void setRequestCompleteTimeAndLog(const LLUUID& id, U64 completeTime);
- U32 getRequestStartTime(const LLUUID& id);
- U32 getRequestSize(const LLUUID& id);
+ void setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime);
+ LLUnit<U32, LLUnits::Microseconds>getRequestStartTime(const LLUUID& id);
+ LLUnit<U32, LLUnits::Bytes> getRequestSize(const LLUUID& id);
U32 getRequestOffset(const LLUUID& id);
LLTextureInfoDetails::LLRequestType getRequestType(const LLUUID& id);
- U32 getRequestCompleteTime(const LLUUID& id);
+ LLUnit<U32, LLUnits::Microseconds> getRequestCompleteTime(const LLUUID& id);
void resetTextureStatistics();
U32 getTextureInfoMapSize();
LLSD getAverages();
@@ -56,19 +57,14 @@ public:
private:
void addRequest(const LLUUID& id);
- std::map<LLUUID, LLTextureInfoDetails *> mTextures;
-
- LLSD mAverages;
-
- bool mLogTextureDownloadsToViewerLog;
- bool mLogTextureDownloadsToSimulator;
- S32 mTotalBytes;
- S32 mTotalMilliseconds;
- S32 mTextureDownloadsStarted;
- S32 mTextureDownloadsCompleted;
- std::string mTextureDownloadProtocol;
- U32 mTextureLogThreshold; // in bytes
- U64 mCurrentStatsBundleStartTime;
+ std::map<LLUUID, LLTextureInfoDetails *> mTextures;
+ LLSD mAverages;
+ bool mLogTextureDownloadsToViewerLog,
+ mLogTextureDownloadsToSimulator;
+ std::string mTextureDownloadProtocol;
+ LLUnit<U32, LLUnits::Bytes> mTextureLogThreshold;
+ LLUnit<U64, LLUnits::Microseconds> mCurrentStatsBundleStartTime;
+ LLTrace::Recording mRecording;
};
#endif // LL_LLTEXTUREINFO_H
diff --git a/indra/newview/lltextureinfodetails.cpp b/indra/newview/lltextureinfodetails.cpp
index 0d750db3bf..cab16eb922 100755
--- a/indra/newview/lltextureinfodetails.cpp
+++ b/indra/newview/lltextureinfodetails.cpp
@@ -28,7 +28,9 @@
#include "lltextureinfodetails.h"
-LLTextureInfoDetails::LLTextureInfoDetails() : mStartTime(0), mCompleteTime(0), mSize(0), mType(REQUEST_TYPE_NONE), mOffset(0)
+LLTextureInfoDetails::LLTextureInfoDetails()
+: mType(REQUEST_TYPE_NONE),
+ mOffset(0)
{
}
diff --git a/indra/newview/lltextureinfodetails.h b/indra/newview/lltextureinfodetails.h
index 4a3cd29084..28e957a7df 100755
--- a/indra/newview/lltextureinfodetails.h
+++ b/indra/newview/lltextureinfodetails.h
@@ -28,10 +28,10 @@
#define LL_LLTEXTUREINFODETAILS_H
#include "lluuid.h"
+#include "llunit.h"
-class LLTextureInfoDetails
+struct LLTextureInfoDetails
{
-public:
enum LLRequestType
{
REQUEST_TYPE_NONE,
@@ -39,11 +39,11 @@ public:
REQUEST_TYPE_UDP
};
- U32 mStartTime;
- U32 mCompleteTime;
- U32 mOffset;
- U32 mSize;
- LLRequestType mType;
+ LLUnit<U32, LLUnits::Microseconds> mStartTime,
+ mCompleteTime;
+ U32 mOffset;
+ LLUnit<U32, LLUnits::Bytes> mSize;
+ LLRequestType mType;
LLTextureInfoDetails();
};
diff --git a/indra/newview/lltexturestats.cpp b/indra/newview/lltexturestats.cpp
index f820ae65df..52fe78abf3 100755
--- a/indra/newview/lltexturestats.cpp
+++ b/indra/newview/lltexturestats.cpp
@@ -48,8 +48,7 @@ void send_texture_stats_to_sim(const LLSD &texture_stats)
texture_stats_report["stats_data"] = texture_stats;
std::string texture_cap_url = gAgent.getRegion()->getCapability("TextureStats");
- LLTextureStatsUploader tsu;
llinfos << "uploading texture stats data to simulator" << llendl;
- tsu.uploadStatsToSimulator(texture_cap_url, texture_stats);
+ LLTextureStatsUploader::uploadStatsToSimulator(texture_cap_url, texture_stats);
}
diff --git a/indra/newview/lltexturestatsuploader.cpp b/indra/newview/lltexturestatsuploader.cpp
index 23ba09cb91..92ec63a113 100755
--- a/indra/newview/lltexturestatsuploader.cpp
+++ b/indra/newview/lltexturestatsuploader.cpp
@@ -30,14 +30,8 @@
#include "llhttpclient.h"
-LLTextureStatsUploader::LLTextureStatsUploader()
-{
-}
-
-LLTextureStatsUploader::~LLTextureStatsUploader()
-{
-}
+// static
void LLTextureStatsUploader::uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats)
{
if ( texture_cap_url != "" )
diff --git a/indra/newview/lltexturestatsuploader.h b/indra/newview/lltexturestatsuploader.h
index 6b02aeb845..ac268c2516 100755
--- a/indra/newview/lltexturestatsuploader.h
+++ b/indra/newview/lltexturestatsuploader.h
@@ -34,9 +34,7 @@
class LLTextureStatsUploader
{
public:
- LLTextureStatsUploader();
- ~LLTextureStatsUploader();
- void uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats);
+ static void uploadStatsToSimulator(const std::string texture_cap_url, const LLSD &texture_stats);
};
#endif // LL_LLTEXTURESTATSUPLOADER_H
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index 6ab2aefc34..80412c215f 100755
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -314,9 +314,9 @@ void LLViewerAssetStats::handleStop()
}
void LLViewerAssetStats::handleReset()
- {
+{
reset();
- }
+}
void LLViewerAssetStats::reset()
@@ -328,6 +328,7 @@ void LLViewerAssetStats::reset()
if (mRegionHandle)
{
mCurRecording = &mRegionRecordings[mRegionHandle];
+ mCurRecording->setPlayState(getPlayState());
}
}
@@ -346,7 +347,7 @@ void LLViewerAssetStats::setRegion(region_handle_t region_handle)
if (region_handle)
{
mCurRecording = &mRegionRecordings[region_handle];
- mCurRecording->start();
+ mCurRecording->setPlayState(getPlayState());
}
mRegionHandle = region_handle;
@@ -493,19 +494,19 @@ void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output)
}
LLSD LLViewerAssetStats::asLLSD(bool compact_output)
- {
+{
LLParamSDParser parser;
LLSD sd;
AssetStats stats;
getStats(stats, compact_output);
LLInitParam::predicate_rule_t rule = LLInitParam::default_parse_rules();
if (!compact_output)
- {
+ {
rule.allow(LLInitParam::EMPTY);
- }
+ }
parser.writeSD(sd, stats, rule);
return sd;
- }
+}
// ------------------------------------------------------
// Global free-function definitions (LLViewerAssetStatsFF namespace)
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index ebc4f09edb..57a0195d23 100755
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -155,7 +155,7 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
setOriginAndLookAt(origin, up_direction, point_of_interest);
- mVelocityDir = center - last_position ;
+ mVelocityDir = origin - last_position ;
F32 dpos = mVelocityDir.normVec() ;
LLQuaternion rotation;
rotation.shortestArc(last_axis, getAtAxis());
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 1de8493749..ee5793fe6a 100755
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -106,6 +106,7 @@ LLFrameTimer gRecentMemoryTime;
void pre_show_depth_buffer();
void post_show_depth_buffer();
void render_ui(F32 zoom_factor = 1.f, int subfield = 0);
+void swap();
void render_hud_attachments();
void render_ui_3d();
void render_ui_2d();
@@ -344,7 +345,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
// Bail out if we're in the startup state and don't want to try to
// render the world.
//
- if (LLStartUp::getStartupState() < STATE_STARTED)
+ if (LLStartUp::getStartupState() < STATE_WEARABLES_WAIT)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Startup");
display_startup();
@@ -553,6 +554,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Disconnected");
render_ui();
+ swap();
}
//////////////////////////
@@ -1021,6 +1023,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLFastTimer t(FTM_RENDER_UI);
render_ui();
+ swap();
}
@@ -1244,8 +1247,6 @@ BOOL setup_hud_matrices(const LLRect& screen_region)
return TRUE;
}
-static LLFastTimer::DeclareTimer FTM_SWAP("Swap");
-
void render_ui(F32 zoom_factor, int subfield)
{
LLGLState::checkStates();
@@ -1322,10 +1323,16 @@ void render_ui(F32 zoom_factor, int subfield)
glh_set_current_modelview(saved_view);
gGL.popMatrix();
}
+}
+
+static LLFastTimer::DeclareTimer FTM_SWAP("Swap");
+
+void swap()
+{
+ LLFastTimer t(FTM_SWAP);
if (gDisplaySwapBuffers)
{
- LLFastTimer t(FTM_SWAP);
gViewerWindow->getWindow()->swapBuffers();
}
gDisplaySwapBuffers = TRUE;
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 3d4c75cec3..244c150b29 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -291,9 +291,9 @@ F32 gAveLandCompression = 0.f,
gWorstWaterCompression = 0.f;
LLUnit<U32, LLUnits::Bytes> gTotalWorldData = 0,
- gTotalObjectData = 0,
- gTotalTextureData = 0;
-U32 gSimPingCount = 0;
+ gTotalObjectData = 0,
+ gTotalTextureData = 0;
+U32 gSimPingCount = 0;
LLUnit<U32, LLUnits::Bits> gObjectData = 0;
F32 gAvgSimPing = 0.f;
LLUnit<U32, LLUnits::Bytes> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0};
@@ -353,7 +353,7 @@ void update_statistics()
}
else
{
- sample(LLStatViewer::SIM_PING, LLUnit<F64, LLUnits::Seconds>(10));
+ sample(LLStatViewer::SIM_PING, LLUnits::Seconds::fromValue(10));
}
if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS))
@@ -403,7 +403,7 @@ void update_statistics()
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
- gTotalTextureData = LLUnit<F64, LLUnits::Bytes>(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT));
+ gTotalTextureData = LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT);
texture_stats_timer.reset();
}
}
diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h
index f077ae1fe1..0248298eb5 100755
--- a/indra/newview/llvocache.h
+++ b/indra/newview/llvocache.h
@@ -35,7 +35,6 @@
//---------------------------------------------------------------------------
// Cache entries
-class LLVOCacheEntry;
class LLCamera;
class LLVOCacheEntry : public LLViewerOctreeEntryData
diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp
index b9712e5e9c..bd42b59df2 100755
--- a/indra/newview/tests/llviewerassetstats_test.cpp
+++ b/indra/newview/tests/llviewerassetstats_test.cpp
@@ -35,6 +35,7 @@
#include "lluuid.h"
#include "llsdutil.h"
#include "llregionhandle.h"
+#include "lltracethreadrecorder.h"
#include "../llvoavatar.h"
namespace LLStatViewer
@@ -231,14 +232,15 @@ namespace tut
{
tst_viewerassetstats_index()
{
- LLTrace::init();
+ LLTrace::set_master_thread_recorder(&mThreadRecorder);
}
~tst_viewerassetstats_index()
{
- LLTrace::cleanup();
+ LLTrace::set_master_thread_recorder(NULL);
}
+ LLTrace::ThreadRecorder mThreadRecorder;
};
typedef test_group<tst_viewerassetstats_index> tst_viewerassetstats_index_t;
typedef tst_viewerassetstats_index_t::object tst_viewerassetstats_index_object_t;