default the UAL off for all targets, enable manually for Interface

This commit is contained in:
Stephen Birarda 2017-07-06 10:21:07 -07:00
parent 86eb5b14ca
commit 916f57772b
5 changed files with 61 additions and 62 deletions

View file

@ -16,7 +16,6 @@
#include <HifiConfigVariantMap.h> #include <HifiConfigVariantMap.h>
#include <SharedUtil.h> #include <SharedUtil.h>
#include <ShutdownEventListener.h> #include <ShutdownEventListener.h>
#include <UserActivityLogger.h>
#include "Assignment.h" #include "Assignment.h"
#include "AssignmentClient.h" #include "AssignmentClient.h"
@ -208,9 +207,6 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) :
DependencyManager::registerInheritance<LimitedNodeList, NodeList>(); DependencyManager::registerInheritance<LimitedNodeList, NodeList>();
// the ACs should not send any user activity events so disable the logger ASAP
UserActivityLogger::getInstance().disable(true);
if (numForks || minForks || maxForks) { if (numForks || minForks || maxForks) {
AssignmentClientMonitor* monitor = new AssignmentClientMonitor(numForks, minForks, maxForks, AssignmentClientMonitor* monitor = new AssignmentClientMonitor(numForks, minForks, maxForks,
requestAssignmentType, assignmentPool, requestAssignmentType, assignmentPool,

View file

@ -42,7 +42,6 @@
#include <NumericalConstants.h> #include <NumericalConstants.h>
#include <Trace.h> #include <Trace.h>
#include <StatTracker.h> #include <StatTracker.h>
#include <UserActivityLogger.h>
#include "DomainServerNodeData.h" #include "DomainServerNodeData.h"
#include "NodeConnectionData.h" #include "NodeConnectionData.h"
@ -76,9 +75,6 @@ DomainServer::DomainServer(int argc, char* argv[]) :
{ {
parseCommandLine(); parseCommandLine();
// the DS should not send any user activity events so disable the logger ASAP
UserActivityLogger::getInstance().disable(true);
DependencyManager::set<tracing::Tracer>(); DependencyManager::set<tracing::Tracer>();
DependencyManager::set<StatTracker>(); DependencyManager::set<StatTracker>();

View file

@ -950,7 +950,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
// Make sure we don't time out during slow operations at startup // Make sure we don't time out during slow operations at startup
updateHeartbeat(); updateHeartbeat();
Setting::Handle<bool> firstRun { Settings::firstRun, true };
// once the settings have been loaded, check if we need to flip the default for UserActivityLogger
auto& userActivityLogger = UserActivityLogger::getInstance();
if (!userActivityLogger.isDisabledSettingSet()) {
// the user activity logger is opt-out for Interface
// but it's defaulted to disabled for other targets
// so we need to enable it here if it has never been disabled by the user
userActivityLogger.disable(false);
}
if (userActivityLogger.isEnabled()) {
// sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value. // sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
// The value will be 0 if the user blew away settings this session, which is both a feature and a bug. // The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
static const QString TESTER = "HIFI_TESTER"; static const QString TESTER = "HIFI_TESTER";
@ -994,14 +1005,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
properties["processor_l3_cache_count"] = procInfo.numProcessorCachesL3; properties["processor_l3_cache_count"] = procInfo.numProcessorCachesL3;
} }
// add firstRun flag from settings to launch event
Setting::Handle<bool> firstRun { Settings::firstRun, true };
properties["first_run"] = firstRun.get(); properties["first_run"] = firstRun.get();
// add the user's machine ID to the launch event // add the user's machine ID to the launch event
properties["machine_fingerprint"] = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint()); properties["machine_fingerprint"] = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
UserActivityLogger::getInstance().logAction("launch", properties); userActivityLogger.logAction("launch", properties);
}
// Tell our entity edit sender about our known jurisdictions // Tell our entity edit sender about our known jurisdictions
_entityEditSender.setServerJurisdictions(&_entityServerJurisdictions); _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions);

View file

@ -33,6 +33,7 @@ public:
public slots: public slots:
bool isEnabled() { return !_disabled.get(); } bool isEnabled() { return !_disabled.get(); }
bool isDisabledSettingSet() const { return _disabled.isSet(); }
void disable(bool disable); void disable(bool disable);
void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters()); void logAction(QString action, QJsonObject details = QJsonObject(), JSONCallbackParameters params = JSONCallbackParameters());
@ -53,7 +54,7 @@ private slots:
private: private:
UserActivityLogger(); UserActivityLogger();
Setting::Handle<bool> _disabled { "UserActivityLoggerDisabled", false }; Setting::Handle<bool> _disabled { "UserActivityLoggerDisabled", true };
QElapsedTimer _timer; QElapsedTimer _timer;
}; };

View file

@ -18,7 +18,6 @@
#include <AddressManager.h> #include <AddressManager.h>
#include <DependencyManager.h> #include <DependencyManager.h>
#include <SettingHandle.h> #include <SettingHandle.h>
#include <UserActivityLogger.h>
#include "ACClientApp.h" #include "ACClientApp.h"
@ -43,9 +42,6 @@ ACClientApp::ACClientApp(int argc, char* argv[]) :
const QCommandLineOption listenPortOption("listenPort", "listen port", QString::number(INVALID_PORT)); const QCommandLineOption listenPortOption("listenPort", "listen port", QString::number(INVALID_PORT));
parser.addOption(listenPortOption); parser.addOption(listenPortOption);
// the AC client should not send any user activity events so disable the logger ASAP
UserActivityLogger::getInstance().disable(true);
if (!parser.parse(QCoreApplication::arguments())) { if (!parser.parse(QCoreApplication::arguments())) {
qCritical() << parser.errorText() << endl; qCritical() << parser.errorText() << endl;
parser.showHelp(); parser.showHelp();