summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llappviewer.cpp17
-rw-r--r--indra/newview/lltexturefetch.cpp7
-rw-r--r--indra/newview/lltexturefetch.h36
-rw-r--r--indra/newview/llviewerassetstats.cpp9
-rw-r--r--indra/newview/llviewerassetstats.h11
-rw-r--r--indra/newview/tests/llviewerassetstats_test.cpp18
6 files changed, 62 insertions, 36 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 587d887146..07f4e71ebf 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -339,6 +339,7 @@ LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ;
static const F32 METRICS_INTERVAL_DEFAULT = 600.0;
static const F32 METRICS_INTERVAL_QA = 30.0;
static F32 app_metrics_interval = METRICS_INTERVAL_DEFAULT;
+static bool app_metrics_qa_mode = false;
void idle_afk_check()
{
@@ -667,17 +668,16 @@ bool LLAppViewer::init()
{
// Viewer metrics initialization
static LLCachedControl<BOOL> metrics_submode(gSavedSettings,
- "QAModeMetricsSubmode",
+ "QAModeMetrics",
FALSE,
- "Enables metrics submode when QAMode is also enabled");
+ "Enables QA features (logging, faster cycling) for metrics collector");
- bool qa_mode(false);
- if (gSavedSettings.getBOOL("QAMode") && metrics_submode)
+ if (metrics_submode)
{
+ app_metrics_qa_mode = true;
app_metrics_interval = METRICS_INTERVAL_QA;
- qa_mode = true;
}
- LLViewerAssetStatsFF::init(qa_mode);
+ LLViewerAssetStatsFF::init();
}
initThreads();
@@ -1760,7 +1760,10 @@ bool LLAppViewer::initThreads()
// Image decoding
LLAppViewer::sImageDecodeThread = new LLImageDecodeThread(enable_threads && true);
LLAppViewer::sTextureCache = new LLTextureCache(enable_threads && true);
- LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && true);
+ LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(),
+ sImageDecodeThread,
+ enable_threads && true,
+ app_metrics_qa_mode);
LLImage::initClass();
if (LLFastTimer::sLog || LLFastTimer::sMetricLog)
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 8e43084adb..2e05a67791 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -1774,7 +1774,7 @@ bool LLTextureFetchWorker::writeToCacheComplete()
//////////////////////////////////////////////////////////////////////////////
// public
-LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded)
+LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded, bool qa_mode)
: LLWorkerThread("TextureFetch", threaded),
mDebugCount(0),
mDebugPause(FALSE),
@@ -1786,7 +1786,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image
mImageDecodeThread(imagedecodethread),
mTextureBandwidth(0),
mHTTPTextureBits(0),
- mCurlGetRequest(NULL)
+ mCurlGetRequest(NULL),
+ mQAMode(qa_mode)
{
mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS");
mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold"));
@@ -2833,7 +2834,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
}
// In QA mode, Metrics submode, log the result for ease of testing
- if (gViewerAssetStatsThread1->isQAMode())
+ if (fetcher->isQAMode())
{
LL_INFOS("QAViewerMetrics") << thread1_stats << LL_ENDL;
}
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index 88b7e4a16b..d46d2da7bc 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -49,7 +49,7 @@ class LLTextureFetch : public LLWorkerThread
friend class HTTPGetResponder;
public:
- LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded);
+ LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded, bool qa_mode);
~LLTextureFetch();
/*virtual*/ S32 update(U32 max_time_ms);
@@ -90,8 +90,10 @@ public:
void commandSendMetrics(const std::string & caps_url, LLSD * report_main);
void commandDataBreak();
- LLCurlRequest & getCurlRequest() { return *mCurlGetRequest; }
-
+ LLCurlRequest & getCurlRequest() { return *mCurlGetRequest; }
+
+ bool isQAMode() const { return mQAMode; }
+
protected:
void addToNetworkQueue(LLTextureFetchWorker* worker);
void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel);
@@ -109,8 +111,33 @@ private:
/*virtual*/ void threadedUpdate(void);
// Metrics command helpers
+ /**
+ * Enqueues a command request at the end of the command queue
+ * and wakes up the thread as needed.
+ *
+ * Takes ownership of the TFRequest object.
+ *
+ * Method locks the command queue.
+ */
void cmdEnqueue(TFRequest *);
+
+ /**
+ * Returns the first TFRequest object in the command queue or
+ * NULL if none is present.
+ *
+ * Caller acquires ownership of the object and must dispose of it.
+ *
+ * Method locks the command queue.
+ */
TFRequest * cmdDequeue();
+
+ /**
+ * Processes the first command in the queue disposing of the
+ * request on completion. Successive calls are needed to perform
+ * additional commands.
+ *
+ * Method locks the command queue.
+ */
void cmdDoWork();
public:
@@ -151,6 +178,9 @@ private:
typedef std::vector<TFRequest *> command_queue_t;
command_queue_t mCommands;
+ // If true, modifies some behaviors that help with QA tasks.
+ const bool mQAMode;
+
public:
// A probabilistically-correct indicator that the current
// attempt to log metrics follows a break in the metrics stream
diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp
index a63c1bf66d..3d7f9f932f 100644
--- a/indra/newview/llviewerassetstats.cpp
+++ b/indra/newview/llviewerassetstats.cpp
@@ -129,8 +129,7 @@ LLViewerAssetStats::PerRegionStats::accumulateTime(duration_t now)
// ------------------------------------------------------
// LLViewerAssetStats class definition
// ------------------------------------------------------
-LLViewerAssetStats::LLViewerAssetStats(bool qa_mode)
- : mQAMode(qa_mode)
+LLViewerAssetStats::LLViewerAssetStats()
{
reset();
}
@@ -540,15 +539,15 @@ record_response_thread1(LLViewerAssetType::EType at, bool with_http, bool is_tem
void
-init(bool qa_mode)
+init()
{
if (! gViewerAssetStatsMain)
{
- gViewerAssetStatsMain = new LLViewerAssetStats(qa_mode);
+ gViewerAssetStatsMain = new LLViewerAssetStats();
}
if (! gViewerAssetStatsThread1)
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats(qa_mode);
+ gViewerAssetStatsThread1 = new LLViewerAssetStats();
}
}
diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h
index 1668a1bc9d..b0fb17ae17 100644
--- a/indra/newview/llviewerassetstats.h
+++ b/indra/newview/llviewerassetstats.h
@@ -140,7 +140,7 @@ public:
};
public:
- LLViewerAssetStats(bool qa_mode);
+ LLViewerAssetStats();
// Default destructor is correct.
LLViewerAssetStats & operator=(const LLViewerAssetStats &); // Not defined
@@ -197,10 +197,6 @@ public:
// final result is undefined (little defensive action).
static void mergeRegionsLLSD(const LLSD & src, LLSD & dst);
- // QA mode is established during initialization so we don't
- // touch LLSD at runtime.
- bool isQAMode() const { return mQAMode; }
-
protected:
typedef std::map<LLUUID, LLPointer<PerRegionStats> > PerRegionContainer;
@@ -219,9 +215,6 @@ protected:
// Time of last reset
duration_t mResetTimestamp;
-
- // QA Mode
- const bool mQAMode;
};
@@ -252,7 +245,7 @@ namespace LLViewerAssetStatsFF
* you'll likely get away with calling it afterwards. cleanup() should only be
* called after threads are shutdown to prevent races on the global pointers.
*/
-void init(bool qa_mode);
+void init();
void cleanup();
diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp
index 5a178fc585..a44712e8ad 100644
--- a/indra/newview/tests/llviewerassetstats_test.cpp
+++ b/indra/newview/tests/llviewerassetstats_test.cpp
@@ -133,7 +133,7 @@ namespace tut
{
ensure("Global gViewerAssetStatsMain should be NULL", (NULL == gViewerAssetStatsMain));
- LLViewerAssetStats * it = new LLViewerAssetStats(false);
+ LLViewerAssetStats * it = new LLViewerAssetStats();
ensure("Global gViewerAssetStatsMain should still be NULL", (NULL == gViewerAssetStatsMain));
@@ -174,7 +174,7 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<3>()
{
- LLViewerAssetStats * it = new LLViewerAssetStats(false);
+ LLViewerAssetStats * it = new LLViewerAssetStats();
it->setRegionID(region1);
LLSD sd = it->asLLSD();
@@ -193,7 +193,7 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<4>()
{
- gViewerAssetStatsMain = new LLViewerAssetStats(false);
+ gViewerAssetStatsMain = new LLViewerAssetStats();
LLViewerAssetStatsFF::set_region_main(region1);
LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
@@ -230,8 +230,8 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<5>()
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats(false);
- gViewerAssetStatsMain = new LLViewerAssetStats(false);
+ gViewerAssetStatsThread1 = new LLViewerAssetStats();
+ gViewerAssetStatsMain = new LLViewerAssetStats();
LLViewerAssetStatsFF::set_region_main(region1);
LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);
@@ -272,7 +272,7 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<6>()
{
- gViewerAssetStatsMain = new LLViewerAssetStats(false);
+ gViewerAssetStatsMain = new LLViewerAssetStats();
LLViewerAssetStatsFF::set_region_main(region1);
@@ -329,7 +329,7 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<7>()
{
- gViewerAssetStatsMain = new LLViewerAssetStats(false);
+ gViewerAssetStatsMain = new LLViewerAssetStats();
LLViewerAssetStatsFF::set_region_main(region1);
@@ -399,8 +399,8 @@ namespace tut
template<> template<>
void tst_viewerassetstats_index_object_t::test<8>()
{
- gViewerAssetStatsThread1 = new LLViewerAssetStats(false);
- gViewerAssetStatsMain = new LLViewerAssetStats(false);
+ gViewerAssetStatsThread1 = new LLViewerAssetStats();
+ gViewerAssetStatsMain = new LLViewerAssetStats();
LLViewerAssetStatsFF::set_region_main(region1);
LLViewerAssetStatsFF::record_enqueue_main(LLViewerAssetType::AT_TEXTURE, false, false);