History

Merge pull request #10843 from birarda/bug/user-activities-interface-only

disable user activity logger in DS/AC/ac-client

Clément Brisset committed 9 years ago

Commit 34e3f562 parents 8945b75 bdcdff36 files · +67 −55Browse files

Showing the changes to interface/src/Application.cpp (1 of 6 files). Show all

Unified · Split

interface/src/Application.cpp+60−50
@@ -952,58 +952,68 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 951 unmodified lines
952 // Make sure we don't time out during slow operations at startup952 // Make sure we don't time out during slow operations at startup
953 updateHeartbeat();953 updateHeartbeat();
954 954
955
956 // sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
957 // The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
958 static const QString TESTER = "HIFI_TESTER";
959 auto gpuIdent = GPUIdent::getInstance();
960 auto glContextData = getGLContextData();
961 QJsonObject properties = {
962 { "version", applicationVersion() },
963 { "tester", QProcessEnvironment::systemEnvironment().contains(TESTER) },
964 { "previousSessionCrashed", _previousSessionCrashed },
965 { "previousSessionRuntime", sessionRunTime.get() },
966 { "cpu_architecture", QSysInfo::currentCpuArchitecture() },
967 { "kernel_type", QSysInfo::kernelType() },
968 { "kernel_version", QSysInfo::kernelVersion() },
969 { "os_type", QSysInfo::productType() },
970 { "os_version", QSysInfo::productVersion() },
971 { "gpu_name", gpuIdent->getName() },
972 { "gpu_driver", gpuIdent->getDriver() },
973 { "gpu_memory", static_cast<qint64>(gpuIdent->getMemory()) },
974 { "gl_version_int", glVersionToInteger(glContextData.value("version").toString()) },
975 { "gl_version", glContextData["version"] },
976 { "gl_vender", glContextData["vendor"] },
977 { "gl_sl_version", glContextData["sl_version"] },
978 { "gl_renderer", glContextData["renderer"] },
979 { "ideal_thread_count", QThread::idealThreadCount() }
980 };
981 auto macVersion = QSysInfo::macVersion();
982 if (macVersion != QSysInfo::MV_None) {
983 properties["os_osx_version"] = QSysInfo::macVersion();
984 }
985 auto windowsVersion = QSysInfo::windowsVersion();
986 if (windowsVersion != QSysInfo::WV_None) {
987 properties["os_win_version"] = QSysInfo::windowsVersion();
988 }
989
990 ProcessorInfo procInfo;
991 if (getProcessorInfo(procInfo)) {
992 properties["processor_core_count"] = procInfo.numProcessorCores;
993 properties["logical_processor_count"] = procInfo.numLogicalProcessors;
994 properties["processor_l1_cache_count"] = procInfo.numProcessorCachesL1;
995 properties["processor_l2_cache_count"] = procInfo.numProcessorCachesL2;
996 properties["processor_l3_cache_count"] = procInfo.numProcessorCachesL3;
997 }
998
999 // add firstRun flag from settings to launch event
1000 Setting::Handle<bool> firstRun { Settings::firstRun, true };955 Setting::Handle<bool> firstRun { Settings::firstRun, true };
1001 properties["first_run"] = firstRun.get();
1002 956
1003 // add the user's machine ID to the launch event957 // once the settings have been loaded, check if we need to flip the default for UserActivityLogger
1004 properties["machine_fingerprint"] = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());958 auto& userActivityLogger = UserActivityLogger::getInstance();
1005 959 if (!userActivityLogger.isDisabledSettingSet()) {
1006 UserActivityLogger::getInstance().logAction("launch", properties);960 // the user activity logger is opt-out for Interface
961 // but it's defaulted to disabled for other targets
962 // so we need to enable it here if it has never been disabled by the user
963 userActivityLogger.disable(false);
964 }
965
966 if (userActivityLogger.isEnabled()) {
967 // sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
968 // The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
969 static const QString TESTER = "HIFI_TESTER";
970 auto gpuIdent = GPUIdent::getInstance();
971 auto glContextData = getGLContextData();
972 QJsonObject properties = {
973 { "version", applicationVersion() },
974 { "tester", QProcessEnvironment::systemEnvironment().contains(TESTER) },
975 { "previousSessionCrashed", _previousSessionCrashed },
976 { "previousSessionRuntime", sessionRunTime.get() },
977 { "cpu_architecture", QSysInfo::currentCpuArchitecture() },
978 { "kernel_type", QSysInfo::kernelType() },
979 { "kernel_version", QSysInfo::kernelVersion() },
980 { "os_type", QSysInfo::productType() },
981 { "os_version", QSysInfo::productVersion() },
982 { "gpu_name", gpuIdent->getName() },
983 { "gpu_driver", gpuIdent->getDriver() },
984 { "gpu_memory", static_cast<qint64>(gpuIdent->getMemory()) },
985 { "gl_version_int", glVersionToInteger(glContextData.value("version").toString()) },
986 { "gl_version", glContextData["version"] },
987 { "gl_vender", glContextData["vendor"] },
988 { "gl_sl_version", glContextData["sl_version"] },
989 { "gl_renderer", glContextData["renderer"] },
990 { "ideal_thread_count", QThread::idealThreadCount() }
991 };
992 auto macVersion = QSysInfo::macVersion();
993 if (macVersion != QSysInfo::MV_None) {
994 properties["os_osx_version"] = QSysInfo::macVersion();
995 }
996 auto windowsVersion = QSysInfo::windowsVersion();
997 if (windowsVersion != QSysInfo::WV_None) {
998 properties["os_win_version"] = QSysInfo::windowsVersion();
999 }
1000
1001 ProcessorInfo procInfo;
1002 if (getProcessorInfo(procInfo)) {
1003 properties["processor_core_count"] = procInfo.numProcessorCores;
1004 properties["logical_processor_count"] = procInfo.numLogicalProcessors;
1005 properties["processor_l1_cache_count"] = procInfo.numProcessorCachesL1;
1006 properties["processor_l2_cache_count"] = procInfo.numProcessorCachesL2;
1007 properties["processor_l3_cache_count"] = procInfo.numProcessorCachesL3;
1008 }
1009
1010 properties["first_run"] = firstRun.get();
1011
1012 // add the user's machine ID to the launch event
1013 properties["machine_fingerprint"] = uuidStringWithoutCurlyBraces(FingerprintUtils::getMachineFingerprint());
1014
1015 userActivityLogger.logAction("launch", properties);
1016 }
1007 1017
1008 // Tell our entity edit sender about our known jurisdictions1018 // Tell our entity edit sender about our known jurisdictions
1009 _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions);1019 _entityEditSender.setServerJurisdictions(&_entityServerJurisdictions);