diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-01 21:38:46 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-01 21:38:46 +0000 |
commit | dd89dec893411c22d4916de14593a56f87d3a284 (patch) | |
tree | 275feb143951d6456dcc4c5612df0289afdc1fad /indra/llui | |
parent | 083b4aa6cb4d8bb38c16ed649e92a16d03a0e3e1 (diff) |
SL-14862 - more types of UI usage logs
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llbutton.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluiusage.cpp | 12 | ||||
-rw-r--r-- | indra/llui/lluiusage.h | 2 |
4 files changed, 23 insertions, 0 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 9682c3bc10..3a3d9254fd 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -47,6 +47,7 @@ #include "llnotificationsutil.h" #include "llrender.h" #include "lluictrlfactory.h" +#include "lluiusage.h" #include "llhelp.h" #include "lldockablefloater.h" #include "llviewereventrecorder.h" @@ -437,6 +438,13 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) setFocus(TRUE); } + if (!mFunctionName.empty()) + { + LL_DEBUGS("UIUsage") << "calling mouse down function " << mFunctionName << LL_ENDL; + LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); + } + /* * ATTENTION! This call fires another mouse down callback. * If you wish to remove this call emit that signal directly diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0e1c8439ea..426c931d07 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -429,6 +429,7 @@ void LLUICtrl::onCommit() { LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL; LLUIUsage::instance().logCommand(mFunctionName); + LLUIUsage::instance().logWidget(getPathname()); } else { diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 50eeccd214..99de4ff78a 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -47,11 +47,19 @@ std::string LLUIUsage::sanitized(const std::string& s) void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; + LL_DEBUGS("UIUsage") << "floater " << floater << LL_ENDL; } void LLUIUsage::logCommand(const std::string& command) { mCommandCounts[sanitized(command)]++; + LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; +} + +void LLUIUsage::logWidget(const std::string& w) +{ + mWidgetCounts[sanitized(w)]++; + LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; } LLSD LLUIUsage::asLLSD() const @@ -65,6 +73,10 @@ LLSD LLUIUsage::asLLSD() const { result["commands"][it.first] = LLSD::Integer(it.second); } + for (auto const& it : mWidgetCounts) + { + result["widgets"][it.first] = LLSD::Integer(it.second); + } return result; } diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h index bac607aa60..efc8bb4032 100644 --- a/indra/llui/lluiusage.h +++ b/indra/llui/lluiusage.h @@ -41,10 +41,12 @@ public: static std::string sanitized(const std::string& s); void logFloater(const std::string& floater); void logCommand(const std::string& command); + void logWidget(const std::string& w); LLSD asLLSD() const; private: std::map<std::string,U32> mFloaterCounts; std::map<std::string,U32> mCommandCounts; + std::map<std::string,U32> mWidgetCounts; }; #endif // LLUIUIUSAGE.h |