diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-05-30 18:15:10 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-05-30 18:15:10 -0400 |
commit | 4f073a8d01f9875a67d53dcf47c6c96e6866956f (patch) | |
tree | cf70639087f1da8c21a41fd9c1c4157d81e1e573 /indra/newview | |
parent | 1faf3d9c5ffa24747d822332233b8c29993d91fb (diff) |
SH-3039 WIP - track sequence number and other standard fields in avatar appearance metrics
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d2609e5587..fbc84c1d32 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2157,7 +2157,12 @@ LLSD LLVOAvatarSelf::metricsData() class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder { public: - ViewerAppearanceChangeMetricsResponder() + ViewerAppearanceChangeMetricsResponder( S32 expected_sequence, + volatile const S32 & live_sequence, + volatile bool & reporting_started): + mExpectedSequence(expected_sequence), + mLiveSequence(live_sequence), + mReportingStarted(reporting_started) { } @@ -2176,14 +2181,44 @@ public: error(status,reason); } } + + // virtual + void error(U32 status_num, const std::string & reason) + { + } + + // virtual + void result(const LLSD & content) + { + if (mLiveSequence == mExpectedSequence) + { + mReportingStarted = true; + } + } + +private: + S32 mExpectedSequence; + volatile const S32 & mLiveSequence; + volatile bool & mReportingStarted; }; void LLVOAvatarSelf::sendAppearanceChangeMetrics() { // gAgentAvatarp->stopAllPhases(); + static volatile bool reporting_started(false); + static volatile S32 report_sequence(0); LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; + msg["session_id"] = gAgentSessionID; + msg["agent_id"] = gAgentID; + msg["sequence"] = report_sequence; + msg["initial"] = !reporting_started; + msg["break"] = false; + + // Update sequence number + if (S32_MAX == ++report_sequence) + report_sequence = 0; LL_DEBUGS("Avatar") << avString() << "message: " << ll_pretty_print_sd(msg) << LL_ENDL; std::string caps_url; @@ -2196,8 +2231,10 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() { LLCurlRequest::headers_t headers; LLHTTPClient::post(caps_url, - msg, - new ViewerAppearanceChangeMetricsResponder); + msg, + new ViewerAppearanceChangeMetricsResponder(report_sequence, + report_sequence, + reporting_started)); } } |