From 272055b6ee6f66b1153f2047a9b4262f868225e0 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 25 Oct 2016 14:19:44 -0700 Subject: [PATCH] add location and build info to user activity stats --- interface/src/Application.cpp | 11 +++++++++++ libraries/networking/src/AddressManager.cpp | 15 +++++++++------ libraries/networking/src/AddressManager.h | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 861e3a2246..e6fc4398c4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1173,10 +1173,21 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo properties["process_memory_used"] = static_cast(memInfo.processUsedMemoryBytes); } + // content location and build info - useful for filtering stats + auto addressManager = DependencyManager::get(); + auto currentDomain = addressManager->currentShareableAddress(true).toString(); // domain only + auto currentPath = addressManager->currentPath(true); // with orientation + properties["current_domain"] = currentDomain; + properties["current_path"] = currentPath; + properties["build_version"] = BuildInfo::VERSION; + + qDebug() << "just sent stats with:" << currentDomain << currentPath << "build:" << BuildInfo::VERSION; + auto displayPlugin = qApp->getActiveDisplayPlugin(); properties["fps"] = _frameCounter.rate(); properties["target_frame_rate"] = getTargetFrameRate(); + properties["render_rate"] = displayPlugin->renderRate(); properties["present_rate"] = displayPlugin->presentRate(); properties["new_frame_present_rate"] = displayPlugin->newFramePresentRate(); properties["dropped_frame_rate"] = displayPlugin->droppedFrameRate(); diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index c40fe29642..90250f839e 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -47,7 +47,7 @@ bool AddressManager::isConnected() { return DependencyManager::get()->getDomainHandler().isConnected(); } -QUrl AddressManager::currentAddress() const { +QUrl AddressManager::currentAddress(bool domainOnly) const { QUrl hifiURL; hifiURL.setScheme(HIFI_URL_SCHEME); @@ -57,7 +57,9 @@ QUrl AddressManager::currentAddress() const { hifiURL.setPort(_port); } - hifiURL.setPath(currentPath()); + if (!domainOnly) { + hifiURL.setPath(currentPath()); + } return hifiURL; } @@ -69,8 +71,7 @@ QUrl AddressManager::currentFacingAddress() const { return hifiURL; } - -QUrl AddressManager::currentShareableAddress() const { +QUrl AddressManager::currentShareableAddress(bool domainOnly) const { if (!_shareablePlaceName.isEmpty()) { // if we have a shareable place name use that instead of whatever the current host is QUrl hifiURL; @@ -78,11 +79,13 @@ QUrl AddressManager::currentShareableAddress() const { hifiURL.setScheme(HIFI_URL_SCHEME); hifiURL.setHost(_shareablePlaceName); - hifiURL.setPath(currentPath()); + if (!domainOnly) { + hifiURL.setPath(currentPath()); + } return hifiURL; } else { - return currentAddress(); + return currentAddress(domainOnly); } } diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 06c5a8c554..ca0585583d 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -63,9 +63,9 @@ public: bool isConnected(); const QString& getProtocol() { return HIFI_URL_SCHEME; }; - QUrl currentAddress() const; + QUrl currentAddress(bool domainOnly = false) const; QUrl currentFacingAddress() const; - QUrl currentShareableAddress() const; + QUrl currentShareableAddress(bool domainOnly = false) const; QUrl currentFacingShareableAddress() const; QString currentPath(bool withOrientation = true) const; QString currentFacingPath() const;