diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-02-07 19:14:00 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-02-07 19:14:00 -0500 |
commit | 99d197d021482ab29ca518d2f2a40462f75fe5a3 (patch) | |
tree | 4771e82b7310f81748bfa87eb1101080bd91ecfa /indra/newview/llvoavatarself.cpp | |
parent | 0897a291d16dc4002765c5eb4ed9e310ee1ba4a4 (diff) |
SH-3852 WIP - track per-timer stats
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a1c7cf97ff..3ae4f9bc71 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -81,7 +81,7 @@ void selfStartPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().startPhase(phase_name); + gAgentAvatarp->startPhase(phase_name); } } @@ -89,7 +89,7 @@ void selfStopPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().stopPhase(phase_name); + gAgentAvatarp->stopPhase(phase_name); } } @@ -97,19 +97,11 @@ void selfClearPhases() { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().clearPhases(); + gAgentAvatarp->clearPhases(); gAgentAvatarp->mLastRezzedStatus = -1; } } -void selfStopAllPhases() -{ - if (isAgentAvatarValid()) - { - gAgentAvatarp->getPhases().stopAllPhases(); - } -} - using namespace LLAvatarAppearanceDefines; /********************************************************************************* @@ -222,6 +214,7 @@ void LLVOAvatarSelf::initInstance() } //doPeriodically(output_self_av_texture_diagnostics, 30.0); + doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, this, false), 5.0); } // virtual @@ -2238,6 +2231,22 @@ private: volatile bool & mReportingStarted; }; +bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) +{ + F32 send_period = 30.0; + + if (force_send || mTimeSinceLastRezMessage.getElapsedTimeF32() > send_period) + { + // Stats for completed phases have been getting logged as they + // complete. This will give us stats for any timers that + // haven't finished as of the metric's being sent. + LLVOAvatar::logPendingPhasesAllAvatars(); + sendAppearanceChangeMetrics(); + } + + return false; +} + void LLVOAvatarSelf::sendAppearanceChangeMetrics() { // gAgentAvatarp->stopAllPhases(); @@ -2251,7 +2260,9 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() msg["sequence"] = report_sequence; msg["initial"] = !reporting_started; msg["break"] = false; - + msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32(); + mTimeSinceLastRezMessage.reset(); + // Update sequence number if (S32_MAX == ++report_sequence) report_sequence = 0; |