From dd89dec893411c22d4916de14593a56f87d3a284 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Mar 2021 21:38:46 +0000 Subject: SL-14862 - more types of UI usage logs --- indra/llui/llbutton.cpp | 8 ++++++++ indra/llui/lluictrl.cpp | 1 + indra/llui/lluiusage.cpp | 12 ++++++++++++ indra/llui/lluiusage.h | 2 ++ 4 files changed, 23 insertions(+) (limited to 'indra/llui') 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 mFloaterCounts; std::map mCommandCounts; + std::map mWidgetCounts; }; #endif // LLUIUIUSAGE.h -- cgit v1.2.3