summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2010-11-23 17:28:21 -0500
committerMonty Brandenberg <monty@lindenlab.com>2010-11-23 17:28:21 -0500
commit6abc60be577bd29c2428d85143c8f583eab54723 (patch)
treeb3b00fb64fc22ca41f1fd253651f332a60295e4f
parent3962b155b4939f831dfd82701d46c4f15aa9f7ac (diff)
ESC-154 ESC-156 Viewer metrics
Get the metrics message generation working in QAModeMetrics mode. Sample interval and data aren't correct yet but getting there.
-rw-r--r--indra/newview/llappviewer.cpp50
1 files changed, 20 insertions, 30 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 07f4e71ebf..86fba90ff7 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -667,9 +667,9 @@ bool LLAppViewer::init()
{
// Viewer metrics initialization
- static LLCachedControl<BOOL> metrics_submode(gSavedSettings,
+ static LLCachedControl<bool> metrics_submode(gSavedSettings,
"QAModeMetrics",
- FALSE,
+ false,
"Enables QA features (logging, faster cycling) for metrics collector");
if (metrics_submode)
@@ -4606,30 +4606,26 @@ void LLAppViewer::metricsIdle(bool enable_reporting)
if (! gViewerAssetStatsMain)
return;
- std::string caps_url;
- LLViewerRegion * regionp = gAgent.getRegion();
- if (regionp)
+ if (LLAppViewer::sTextureFetch)
{
- caps_url = regionp->getCapability("ViewerMetrics");
- }
-
- if (enable_reporting && regionp && ! caps_url.empty())
- {
- // *NOTE: Pay attention here. LLSD's are not safe for thread sharing
- // and their ownership is difficult to transfer across threads. We do
- // it here by having only one reference (the new'd pointer) to the LLSD
- // or any subtree of it. This pointer is then transfered to the other
- // thread using correct thread logic.
-
- LLSD * envelope = new LLSD(LLSD::emptyMap());
+ LLViewerRegion * regionp = gAgent.getRegion();
+
+ if (enable_reporting && regionp)
{
- (*envelope) = gViewerAssetStatsMain->asLLSD();
- (*envelope)["session_id"] = gAgentSessionID;
- (*envelope)["agent_id"] = gAgentID;
- }
+ std::string caps_url = regionp->getCapability("ViewerMetrics");
+
+ // *NOTE: Pay attention here. LLSD's are not safe for thread sharing
+ // and their ownership is difficult to transfer across threads. We do
+ // it here by having only one reference (the new'd pointer) to the LLSD
+ // or any subtree of it. This pointer is then transfered to the other
+ // thread using correct thread logic to do all data ordering.
+ LLSD * envelope = new LLSD(LLSD::emptyMap());
+ {
+ (*envelope) = gViewerAssetStatsMain->asLLSD();
+ (*envelope)["session_id"] = gAgentSessionID;
+ (*envelope)["agent_id"] = gAgentID;
+ }
- if (LLAppViewer::sTextureFetch)
- {
// Send a report request into 'thread1' to get the rest of the data
// and have it sent to the stats collector. LLSD ownership transfers
// with this call.
@@ -4638,15 +4634,9 @@ void LLAppViewer::metricsIdle(bool enable_reporting)
}
else
{
- // No 'thread1' so transfer doesn't happen and we need to clean up
- delete envelope;
- envelope = 0;
+ LLAppViewer::sTextureFetch->commandDataBreak();
}
}
- else
- {
- LLAppViewer::sTextureFetch->commandDataBreak();
- }
// 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