diff options
-rw-r--r-- | indra/llui/llbutton.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lluiusage.cpp | 36 | ||||
-rw-r--r-- | indra/llui/lluiusage.h | 4 |
4 files changed, 23 insertions, 21 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 3a3d9254fd..0e59fdf519 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -442,7 +442,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) { LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } /* diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 426c931d07..5924542a19 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,7 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); - LLUIUsage::instance().logWidget(getPathname()); + LLUIUsage::instance().logControl(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 60c124b711..ccae6643b9 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -39,7 +39,7 @@ LLUIUsage::~LLUIUsage() // static std::string LLUIUsage::sanitized(const std::string& s) { - // ViewerStats db doesn't like "." in keys + // Remove characters that make the ViewerStats db unhappy std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); std::replace(result.begin(), result.end(), ' ', '_'); @@ -59,10 +59,11 @@ void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, con setLLSDNested(sd, last_fields, val); } -// setLLSDNested +// setLLSDNested() // Accomplish the equivalent of // sd[fields[0]][fields[1]]... = val; // for an arbitrary number of fields. +// This might be useful as an LLSD utility function; is not specific to LLUIUsage // // static void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector<std::string>& fields, const LLSD& val) @@ -91,6 +92,13 @@ void LLUIUsage::logCommand(const std::string& command) LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; } +void LLUIUsage::logControl(const std::string& control) +{ + mControlCounts[sanitized(control)]++; + LL_DEBUGS("UIUsage") << "control " << control << LL_ENDL; +} + + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -103,30 +111,24 @@ void LLUIUsage::logPanel(const std::string& p) LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } -void LLUIUsage::logWidget(const std::string& w) -{ - mWidgetCounts[sanitized(w)]++; - LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; -} - LLSD LLUIUsage::asLLSD() const { LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } for (auto const& it : mCommandCounts) { result["commands"][it.first] = LLSD::Integer(it.second); } - for (auto const& it : mPanelCounts) + for (auto const& it : mControlCounts) { - result["panels"][it.first] = LLSD::Integer(it.second); + setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second)); } - for (auto const& it : mWidgetCounts) + for (auto const& it : mFloaterCounts) { - setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); } return result; } @@ -137,8 +139,8 @@ void LLUIUsage::clear() LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; mCommandCounts.clear(); + mControlCounts.clear(); mFloaterCounts.clear(); mPanelCounts.clear(); - mWidgetCounts.clear(); } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index e642c55e0f..a30cd80db3 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -42,16 +42,16 @@ public: static void setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, const LLSD& val); static void setLLSDNested(LLSD& sd, const std::vector<std::string>& fields, const LLSD& val); void logCommand(const std::string& command); + void logControl(const std::string& control); void logFloater(const std::string& floater); void logPanel(const std::string& p); - void logWidget(const std::string& w); LLSD asLLSD() const; void clear(); private: std::map<std::string,U32> mCommandCounts; + std::map<std::string,U32> mControlCounts; std::map<std::string,U32> mFloaterCounts; std::map<std::string,U32> mPanelCounts; - std::map<std::string,U32> mWidgetCounts; }; #endif // LLUIUIUSAGE.h |