summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/CMakeLists.txt2
-rw-r--r--indra/llui/llfloaterreg.cpp8
-rw-r--r--indra/llui/lluictrl.cpp21
-rw-r--r--indra/llui/lluictrl.h4
-rw-r--r--indra/llui/lluiusage.cpp61
-rw-r--r--indra/llui/lluiusage.h49
-rw-r--r--indra/newview/llviewerstats.cpp3
7 files changed, 147 insertions, 1 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index cce618487b..f781ff4110 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -122,6 +122,7 @@ set(llui_SOURCE_FILES
lluictrl.cpp
lluictrlfactory.cpp
lluistring.cpp
+ lluiusage.cpp
llundo.cpp
llurlaction.cpp
llurlentry.cpp
@@ -241,6 +242,7 @@ set(llui_HEADER_FILES
llui.h
lluicolor.h
lluistring.h
+ lluiusage.h
llundo.h
llurlaction.h
llurlentry.h
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp
index 85e07fc6a6..6307bf1028 100644
--- a/indra/llui/llfloaterreg.cpp
+++ b/indra/llui/llfloaterreg.cpp
@@ -32,6 +32,7 @@
#include "llfloater.h"
#include "llmultifloater.h"
#include "llfloaterreglistener.h"
+#include "lluiusage.h"
//*******************************************************
@@ -243,6 +244,8 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str
//static
LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, BOOL focus)
{
+ LL_DEBUGS("UIUsage") << "floater showInstance " << name << LL_ENDL;
+ LLUIUsage::instance().logFloater(name);
if( sBlockShowFloaters
// see EXT-7090
&& sAlwaysShowableList.find(name) == sAlwaysShowableList.end())
@@ -273,6 +276,9 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key)
// returns true if the instance is visible when completed
bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
{
+ LL_DEBUGS("UIUsage") << "floater toggleInstance " << name << LL_ENDL;
+ LLUIUsage::instance().logFloater(name);
+
LLFloater* instance = findInstance(name, key);
if (LLFloater::isShown(instance))
{
@@ -473,6 +479,8 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD&
LLFloater* instance = getInstance(name, key);
+ LL_DEBUGS("UIUsage") << "floater toggleInstanceOrBringToFront " << name << LL_ENDL;
+ LLUIUsage::instance().logFloater(name);
if (!instance)
{
LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL;
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 544a76e8d5..0e1c8439ea 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -35,6 +35,7 @@
#include "lluictrlfactory.h"
#include "lltabcontainer.h"
#include "llaccordionctrltab.h"
+#include "lluiusage.h"
static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl");
@@ -282,6 +283,7 @@ LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCa
else
{
std::string function_name = cb.function_name;
+ setFunctionName(function_name);
commit_callback_t* func = (CommitCallbackRegistry::getValue(function_name));
if (func)
{
@@ -422,7 +424,18 @@ BOOL LLUICtrl::canFocusChildren() const
void LLUICtrl::onCommit()
{
if (mCommitSignal)
- (*mCommitSignal)(this, getValue());
+ {
+ if (!mFunctionName.empty())
+ {
+ LL_DEBUGS("UIUsage") << "calling commit function " << mFunctionName << LL_ENDL;
+ LLUIUsage::instance().logCommand(mFunctionName);
+ }
+ else
+ {
+ //LL_DEBUGS("UIUsage") << "calling commit function " << "UNKNOWN" << LL_ENDL;
+ }
+ (*mCommitSignal)(this, getValue());
+ }
}
//virtual
@@ -597,6 +610,12 @@ void LLUICtrl::setMakeInvisibleControlVariable(LLControlVariable* control)
setVisible(!(mMakeInvisibleControlVariable->getValue().asBoolean()));
}
}
+
+void LLUICtrl::setFunctionName(const std::string& function_name)
+{
+ mFunctionName = function_name;
+}
+
// static
bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type)
{
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 7360bd7659..67dd24341c 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -183,6 +183,8 @@ public:
void setMakeVisibleControlVariable(LLControlVariable* control);
void setMakeInvisibleControlVariable(LLControlVariable* control);
+ void setFunctionName(const std::string& function_name);
+
virtual void setTentative(BOOL b);
virtual BOOL getTentative() const;
virtual void setValue(const LLSD& value);
@@ -310,6 +312,8 @@ protected:
LLControlVariable* mMakeInvisibleControlVariable;
boost::signals2::connection mMakeInvisibleControlConnection;
+ std::string mFunctionName;
+
static F32 sActiveControlTransparency;
static F32 sInactiveControlTransparency;
diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp
new file mode 100644
index 0000000000..e1237031cd
--- /dev/null
+++ b/indra/llui/lluiusage.cpp
@@ -0,0 +1,61 @@
+/**
+* @file lluiuisage.cpp
+* @brief Source file for LLUIUsage
+*
+* $LicenseInfo:firstyear=2021&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2021, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#include "linden_common.h"
+#include "lluiusage.h"
+
+LLUIUsage::LLUIUsage()
+{
+}
+
+LLUIUsage::~LLUIUsage()
+{
+}
+
+void LLUIUsage::logFloater(const std::string& floater)
+{
+ mFloaterCounts[floater]++;
+}
+
+void LLUIUsage::logCommand(const std::string& command)
+{
+ mCommandCounts[command]++;
+}
+
+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);
+ }
+ return result;
+}
+
diff --git a/indra/llui/lluiusage.h b/indra/llui/lluiusage.h
new file mode 100644
index 0000000000..0c076c2b2c
--- /dev/null
+++ b/indra/llui/lluiusage.h
@@ -0,0 +1,49 @@
+/**
+* @file lluiuisage.h
+* @brief Header file for LLUIUsage
+*
+* $LicenseInfo:firstyear=2021&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2021, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#ifndef LL_LLUIUSAGE_H
+#define LL_LLUIUSAGE_H
+
+#include <map>
+#include "llsd.h"
+#include "llsingleton.h"
+
+// UIUsage tracking to see which operations and UI elements are most popular in a session
+class LLUIUsage : public LLSingleton<LLUIUsage>
+{
+public:
+ LLSINGLETON(LLUIUsage);
+ ~LLUIUsage();
+public:
+ void logFloater(const std::string& floater);
+ void logCommand(const std::string& command);
+ LLSD asLLSD() const;
+private:
+ std::map<std::string,U32> mFloaterCounts;
+ std::map<std::string,U32> mCommandCounts;
+};
+
+#endif // LLUIUIUSAGE.h
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 05f88b0a75..314c1a1f1e 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -63,6 +63,7 @@
#include "llsdutil.h"
#include "llcorehttputil.h"
#include "llvoicevivox.h"
+#include "lluiusage.h"
namespace LLStatViewer
{
@@ -577,6 +578,8 @@ void send_viewer_stats(bool include_preferences)
fail["invalid"] = (S32) gMessageSystem->mInvalidOnCircuitPackets;
fail["missing_updater"] = (S32) LLAppViewer::instance()->isUpdaterMissing();
+ body["ui"] = LLUIUsage::instance().asLLSD();
+
body["stats"]["voice"] = LLVoiceVivoxStats::getInstance()->read();
// Misc stats, two strings and two ints