From 72fe3a66f54a892de983ca4f7a97d939c7fb1fcd Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 13 May 2019 15:56:55 -0700 Subject: [PATCH 1/4] Debugging code to monitor the queue depth for a few critical threads --- assignment-client/src/audio/AudioMixer.cpp | 8 ++++ .../src/audio/AudioMixerSlavePool.cpp | 13 ++++++ .../src/audio/AudioMixerSlavePool.h | 6 ++- assignment-client/src/avatars/AvatarMixer.cpp | 8 ++++ .../src/avatars/AvatarMixerSlavePool.cpp | 13 ++++++ .../src/avatars/AvatarMixerSlavePool.h | 6 +++ cmake/macros/SetupQt.cmake | 9 +++-- interface/resources/qml/Stats.qml | 10 +++++ interface/src/Application.cpp | 37 ++--------------- interface/src/ui/Stats.cpp | 5 +++ interface/src/ui/Stats.h | 31 ++++++++++++++ libraries/networking/src/DomainHandler.cpp | 8 ++++ .../networking/src/ThreadedAssignment.cpp | 5 +++ libraries/shared/CMakeLists.txt | 2 + libraries/shared/src/shared/QtHelpers.cpp | 40 +++++++++++++++++++ libraries/shared/src/shared/QtHelpers.h | 14 +++++++ 16 files changed, 177 insertions(+), 38 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index eb487df850..161a6f4285 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -269,6 +270,13 @@ void AudioMixer::sendStatsPacket() { return; } +#ifdef DEBUG_EVENT_QUEUE + QJsonObject qtStats; + + _slavePool.queueStats(qtStats); + statsObject["audio_thread_event_queue"] = qtStats; +#endif + // general stats statsObject["useDynamicJitterBuffers"] = _numStaticJitterFrames == DISABLE_STATIC_JITTER_FRAMES; diff --git a/assignment-client/src/audio/AudioMixerSlavePool.cpp b/assignment-client/src/audio/AudioMixerSlavePool.cpp index 78efb98b37..16cfa8217b 100644 --- a/assignment-client/src/audio/AudioMixerSlavePool.cpp +++ b/assignment-client/src/audio/AudioMixerSlavePool.cpp @@ -113,6 +113,19 @@ void AudioMixerSlavePool::each(std::function funct } } +#ifdef DEBUG_EVENT_QUEUE +void AudioMixerSlavePool::queueStats(QJsonObject & stats) { + unsigned i = 0; + for (auto& slave : _slaves) { + int queueSize = ::hifi::qt::getEventQueueSize(slave.get()); + QString queueName = QString("audio_thread_event_queue_%1").arg(i); + stats[queueName] = queueSize; + + i++; + } +} +#endif // DEBUG_EVENT_QUEUE + void AudioMixerSlavePool::setNumThreads(int numThreads) { // clamp to allowed size { diff --git a/assignment-client/src/audio/AudioMixerSlavePool.h b/assignment-client/src/audio/AudioMixerSlavePool.h index 82b892123c..efb9c920d9 100644 --- a/assignment-client/src/audio/AudioMixerSlavePool.h +++ b/assignment-client/src/audio/AudioMixerSlavePool.h @@ -17,7 +17,7 @@ #include #include - +#include #include #include "AudioMixerSlave.h" @@ -72,6 +72,10 @@ public: // iterate over all slaves void each(std::function functor); +#ifdef DEBUG_EVENT_QUEUE + void queueStats(QJsonObject & stats); +#endif + void setNumThreads(int numThreads); int numThreads() { return _numThreads; } diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 3e93981ed3..2b0df4a9d6 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -753,6 +754,13 @@ void AvatarMixer::sendStatsPacket() { statsObject["trailing_mix_ratio"] = _trailingMixRatio; statsObject["throttling_ratio"] = _throttlingRatio; +#ifdef DEBUG_EVENT_QUEUE + QJsonObject qtStats; + + _slavePool.queueStats(qtStats); + statsObject["avatar_thread_event_queue"] = qtStats; +#endif + // this things all occur on the frequency of the tight loop int tightLoopFrames = _numTightLoopFrames; int tenTimesPerFrame = tightLoopFrames * 10; diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp index 357b347a94..e92b09bc07 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp @@ -117,6 +117,19 @@ void AvatarMixerSlavePool::each(std::function fun } } +#ifdef DEBUG_EVENT_QUEUE +void AvatarMixerSlavePool::queueStats(QJsonObject & stats) { + unsigned i = 0; + for (auto& slave : _slaves) { + int queueSize = ::hifi::qt::getEventQueueSize(slave.get()); + QString queueName = QString("avatar_thread_event_queue_%1").arg(i); + stats[queueName] = queueSize; + + i++; + } +} +#endif // DEBUG_EVENT_QUEUE + void AvatarMixerSlavePool::setNumThreads(int numThreads) { // clamp to allowed size { diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.h b/assignment-client/src/avatars/AvatarMixerSlavePool.h index b05abde2a3..9a8105eac1 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.h +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.h @@ -20,9 +20,11 @@ #include #include +#include #include "AvatarMixerSlave.h" + class AvatarMixerSlavePool; class AvatarMixerSlaveThread : public QThread, public AvatarMixerSlave { @@ -72,6 +74,10 @@ public: // iterate over all slaves void each(std::function functor); +#ifdef DEBUG_EVENT_QUEUE + void AvatarMixerSlavePool::queueStats(QJsonObject & stats); +#endif + void setNumThreads(int numThreads); int numThreads() const { return _numThreads; } diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 71f5314d2f..a1ea9b68bc 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -7,7 +7,8 @@ # # Construct a default QT location from a root path, a version and an architecture -function(calculate_default_qt_dir _RESULT_NAME) + +function(calculate_default_qt_dir _QT_VERSION _RESULT_NAME) if (ANDROID) set(QT_DEFAULT_ARCH "android_armv7") elseif(UWP) @@ -27,22 +28,22 @@ function(calculate_default_qt_dir _RESULT_NAME) endif() set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT}) - set_from_env(QT_VERSION QT_VERSION "5.10.1") set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH}) - set(${_RESULT_NAME} "${QT_ROOT}/${QT_VERSION}/${QT_ARCH}" PARENT_SCOPE) + set(${_RESULT_NAME} "${QT_ROOT}/${_QT_VERSION}/${QT_ARCH}" PARENT_SCOPE) endfunction() # Sets the QT_CMAKE_PREFIX_PATH and QT_DIR variables # Also enables CMAKE_AUTOMOC and CMAKE_AUTORCC macro(setup_qt) + set_from_env(QT_VERSION QT_VERSION "5.10.1") # if QT_CMAKE_PREFIX_PATH was not specified before hand, # try to use the environment variable if (NOT QT_CMAKE_PREFIX_PATH) set(QT_CMAKE_PREFIX_PATH "$ENV{QT_CMAKE_PREFIX_PATH}") endif() if (("QT_CMAKE_PREFIX_PATH" STREQUAL "") OR (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}")) - calculate_default_qt_dir(QT_DIR) + calculate_default_qt_dir(${QT_VERSION} QT_DIR) set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/lib/cmake") else() # figure out where the qt dir is diff --git a/interface/resources/qml/Stats.qml b/interface/resources/qml/Stats.qml index 135633e403..1180a952c3 100644 --- a/interface/resources/qml/Stats.qml +++ b/interface/resources/qml/Stats.qml @@ -147,6 +147,16 @@ Item { "Parabolas:\t" + root.parabolaPicksUpdated.x + "/" + root.parabolaPicksUpdated.y + "/" + root.parabolaPicksUpdated.z + "\n " + "Colliders:\t" + root.collisionPicksUpdated.x + "/" + root.collisionPicksUpdated.y + "/" + root.collisionPicksUpdated.z } + StatText { + visible: { root.eventQueueDebuggingOn && root.expanded } + text: { if (root.eventQueueDebuggingOn) + return "Event Queue Depth\n " + + "Main:\t" + root.mainThreadQueueDepth + "\n" + + "NodeList:\t" + root.nodeListThreadQueueDepth; + else + return ""; + } + } } } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bf9df95ac0..a8c5e3d820 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -253,17 +253,6 @@ #if defined(Q_OS_WIN) #include -#ifdef DEBUG_EVENT_QUEUE -// This is a HACK that uses private headers included with the qt source distrubution. -// To use this feature you need to add these directores to your include path: -// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1/QtCore -// E:/Qt/5.10.1/Src/qtbase/include/QtCore/5.10.1 -#define QT_BOOTSTRAPPED -#include -#include -#undef QT_BOOTSTRAPPED -#endif - // On Windows PC, NVidia Optimus laptop, we want to enable NVIDIA GPU // FIXME seems to be broken. extern "C" { @@ -4011,24 +4000,6 @@ bool Application::handleFileOpenEvent(QFileOpenEvent* fileEvent) { return false; } -#ifdef DEBUG_EVENT_QUEUE -static int getEventQueueSize(QThread* thread) { - auto threadData = QThreadData::get2(thread); - QMutexLocker locker(&threadData->postEventList.mutex); - return threadData->postEventList.size(); -} - -static void dumpEventQueue(QThread* thread) { - auto threadData = QThreadData::get2(thread); - QMutexLocker locker(&threadData->postEventList.mutex); - qDebug() << "Event list, size =" << threadData->postEventList.size(); - for (auto& postEvent : threadData->postEventList) { - QEvent::Type type = (postEvent.event ? postEvent.event->type() : QEvent::None); - qDebug() << " " << type; - } -} -#endif // DEBUG_EVENT_QUEUE - bool Application::notify(QObject * object, QEvent * event) { if (thread() == QThread::currentThread()) { PROFILE_RANGE_IF_LONGER(app, "notify", 2) @@ -4064,14 +4035,14 @@ bool Application::event(QEvent* event) { case ApplicationEvent::Idle: idle(); -#ifdef DEBUG_EVENT_QUEUE +#ifdef DEBUG_EVENT_QUEUE_DEPTH { - int count = getEventQueueSize(QThread::currentThread()); + int count = ::hifi::qt::getEventQueueSize(QThread::currentThread()); if (count > 400) { - dumpEventQueue(QThread::currentThread()); + ::hifi::qt::dumpEventQueue(QThread::currentThread()); } } -#endif // DEBUG_EVENT_QUEUE +#endif // DEBUG_EVENT_QUEUE_DEPTH _pendingIdleEvent.store(false); diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 8f289812fa..d243fa9ebf 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -180,6 +180,11 @@ void Stats::updateStats(bool force) { STAT_UPDATE_FLOAT(mbpsIn, nodeList->getInboundKbps() / 1000.0f, 0.01f); STAT_UPDATE_FLOAT(mbpsOut, nodeList->getOutboundKbps() / 1000.0f, 0.01f); +#ifdef DEBUG_EVENT_QUEUE + STAT_UPDATE(mainThreadQueueDepth, ::hifi::qt::getEventQueueSize(QThread::currentThread())); + STAT_UPDATE(nodeListThreadQueueDepth, ::hifi::qt::getEventQueueSize(nodeList->thread())); +#endif + SharedNodePointer audioMixerNode = nodeList->soloNodeOfType(NodeType::AudioMixer); SharedNodePointer avatarMixerNode = nodeList->soloNodeOfType(NodeType::AvatarMixer); SharedNodePointer assetServerNode = nodeList->soloNodeOfType(NodeType::AssetServer); diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 7709f2d6dc..1939e7fa0e 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -14,6 +14,7 @@ #include #include #include +#include #define STATS_PROPERTY(type, name, initialValue) \ Q_PROPERTY(type name READ name NOTIFY name##Changed) \ @@ -179,6 +180,7 @@ private: \ * @property {Vec3} rayPicksUpdated - Read-only. * @property {Vec3} parabolaPicksUpdated - Read-only. * @property {Vec3} collisionPicksUpdated - Read-only. + * @property {bool} eventQueueDebuggingOn - Read-only. */ // Properties from x onwards are QQuickItem properties. @@ -312,6 +314,14 @@ class Stats : public QQuickItem { STATS_PROPERTY(QVector3D, parabolaPicksUpdated, QVector3D(0, 0, 0)) STATS_PROPERTY(QVector3D, collisionPicksUpdated, QVector3D(0, 0, 0)) +#ifdef DEBUG_EVENT_QUEUE + STATS_PROPERTY(bool, eventQueueDebuggingOn, true) + STATS_PROPERTY(int, mainThreadQueueDepth, -1); + STATS_PROPERTY(int, nodeListThreadQueueDepth, -1); +#else + STATS_PROPERTY(bool, eventQueueDebuggingOn, false) +#endif // DEBUG_EVENT_QUEUE + public: static Stats* getInstance(); @@ -1357,6 +1367,27 @@ signals: */ void collisionPicksUpdatedChanged(); + /**jsdoc + * Triggered when the value of the eventQueueDebuggingOn property changes. + * @function Stats.eventQueueDebuggingOn + * @returns {Signal} + */ + void eventQueueDebuggingOnChanged(); + + /**jsdoc + * Triggered when the value of the nodeListThreadQueueDepth property changes. + * @function Stats.nodeListThreadQueueDepth + * @returns {Signal} + */ + void nodeListThreadQueueDepthChanged(); + + /**jsdoc + * Triggered when the value of the nodeListThreadQueueDepth property changes. + * @function Stats.nodeListThreadQueueDepth + * @returns {Signal} + */ + void mainThreadQueueDepthChanged(); + private: int _recentMaxPackets{ 0 } ; // recent max incoming voxel packets to process bool _resetRecentMaxPacketsSoon{ true }; diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 2513510b05..2267eed973 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -547,9 +547,17 @@ bool DomainHandler::checkInPacketTimeout() { ++_checkInPacketsSinceLastReply; if (_checkInPacketsSinceLastReply > MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { + + auto nodeList = DependencyManager::get(); + // we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS // so emit our signal that says that +#ifdef DEBUG_EVENT_QUEUE + int nodeListQueueSize = ::hifi::qt::getEventQueueSize(nodeList->thread()); + qCDebug(networking) << "Limit of silent domain checkins reached (network qt queue: " << nodeListQueueSize << ")"; +#else // DEBUG_EVENT_QUEUE qCDebug(networking) << "Limit of silent domain checkins reached"; +#endif // DEBUG_EVENT_QUEUE emit limitOfSilentDomainCheckInsReached(); return true; } else { diff --git a/libraries/networking/src/ThreadedAssignment.cpp b/libraries/networking/src/ThreadedAssignment.cpp index 9b9a53b469..ed99a50665 100644 --- a/libraries/networking/src/ThreadedAssignment.cpp +++ b/libraries/networking/src/ThreadedAssignment.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "NetworkLogging.h" @@ -94,6 +95,10 @@ void ThreadedAssignment::commonInit(const QString& targetName, NodeType_t nodeTy void ThreadedAssignment::addPacketStatsAndSendStatsPacket(QJsonObject statsObject) { auto nodeList = DependencyManager::get(); +#ifdef DEBUG_EVENT_QUEUE + statsObject["nodelist_event_queue_size"] = ::hifi::qt::getEventQueueSize(nodeList->thread()); +#endif + QJsonObject ioStats; ioStats["inbound_kbps"] = nodeList->getInboundKbps(); ioStats["inbound_pps"] = nodeList->getInboundPPS(); diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 713501aa77..093e3249f2 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -1,5 +1,7 @@ set(TARGET_NAME shared) +include_directories("${QT_DIR}/include/QtCore/${QT_VERSION}/QtCore" "${QT_DIR}/include/QtCore/${QT_VERSION}") + # TODO: there isn't really a good reason to have Script linked here - let's get what is requiring it out (RegisteredMetaTypes.cpp) setup_hifi_library(Gui Network Script) diff --git a/libraries/shared/src/shared/QtHelpers.cpp b/libraries/shared/src/shared/QtHelpers.cpp index 3e8c6d57ed..ed387a9763 100644 --- a/libraries/shared/src/shared/QtHelpers.cpp +++ b/libraries/shared/src/shared/QtHelpers.cpp @@ -13,6 +13,17 @@ #include #include +// Inspecting of the qt event queue depth +// requres access to private Qt datastructures +// defined in private Qt headers +#ifdef DEBUG_EVENT_QUEUE +#include "../TryLocker.h" +#define QT_BOOTSTRAPPED +#include +#include +#undef QT_BOOTSTRAPPED +#endif // DEBUG_EVENT_QUEUE + #include "../Profile.h" Q_LOGGING_CATEGORY(thread_safety, "hifi.thread_safety") @@ -80,6 +91,35 @@ bool blockingInvokeMethod( return blockingInvokeMethod(function, obj, member, QGenericReturnArgument(), val0, val1, val2, val3, val4, val5, val6, val7, val8, val9); } +// Inspecting of the qt event queue +// requres access to private Qt datastructures +// Querying the event queue should be done with +// care as it could lock the threadData->postEventList.mutex +// The code uses a tryLock to avoid the possability of a +// deadlock during a call to this code, although that is unlikely +// +#ifdef DEBUG_EVENT_QUEUE +int getEventQueueSize(QThread* thread) { + auto threadData = QThreadData::get2(thread); + { + MutexTryLocker locker(threadData->postEventList.mutex); + if (locker.isLocked()) { + return threadData->postEventList.size(); + } + } + return -1; +} +void dumpEventQueue(QThread* thread) { + auto threadData = QThreadData::get2(thread); + QMutexLocker locker(&threadData->postEventList.mutex); + qDebug() << "Event list, size =" << threadData->postEventList.size(); + for (auto& postEvent : threadData->postEventList) { + QEvent::Type type = (postEvent.event ? postEvent.event->type() : QEvent::None); + qDebug() << " " << type; + } +} + +#endif // DEBUG_EVENT_QUEUE } } diff --git a/libraries/shared/src/shared/QtHelpers.h b/libraries/shared/src/shared/QtHelpers.h index 3387be6909..faaf53e7dc 100644 --- a/libraries/shared/src/shared/QtHelpers.h +++ b/libraries/shared/src/shared/QtHelpers.h @@ -12,6 +12,8 @@ #include +// Enable event queue debugging +#define DEBUG_EVENT_QUEUE namespace hifi { namespace qt { void addBlockingForbiddenThread(const QString& name, QThread* thread = nullptr); @@ -45,6 +47,18 @@ bool blockingInvokeMethod( QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()); +// Inspecting of the qt event queue +// requres access to private Qt datastructures +// Querying the event queue should be done with +// care as it could lock the threadData->postEventList.mutex +// The code uses a tryLock to avoid the possability of a +// deadlock during a call to this code, although that is unlikely +// When getEventQueueSize fails to get the lock, it returns -1 +#ifdef DEBUG_EVENT_QUEUE + int getEventQueueSize(QThread* thread); + void dumpEventQueue(QThread* thread); +#endif // DEBUG_EVENT_QUEUE + } } #define BLOCKING_INVOKE_METHOD(obj, member, ...) \ From 4ad3163ca5228334b17d140e7ace281abd2e0aa4 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 13 May 2019 16:37:45 -0700 Subject: [PATCH 2/4] Disable event queue debugging for non-windows platforms. --- libraries/shared/src/shared/QtHelpers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/shared/src/shared/QtHelpers.h b/libraries/shared/src/shared/QtHelpers.h index faaf53e7dc..cde6ecdbb7 100644 --- a/libraries/shared/src/shared/QtHelpers.h +++ b/libraries/shared/src/shared/QtHelpers.h @@ -12,8 +12,10 @@ #include +#ifdef WIN32 // Enable event queue debugging #define DEBUG_EVENT_QUEUE +#endif // WIN32 namespace hifi { namespace qt { void addBlockingForbiddenThread(const QString& name, QThread* thread = nullptr); From aa16430cf4c2605e838e8f64f8c7066a7f5b8296 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 13 May 2019 17:25:06 -0700 Subject: [PATCH 3/4] add a comment and kick build servers --- interface/src/Application.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f9e9911d2a..662c7243d0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4047,6 +4047,8 @@ bool Application::event(QEvent* event) { idle(); #ifdef DEBUG_EVENT_QUEUE_DEPTH + // The event queue may very well grow beyond 400, so + // this code should only be enabled on local builds { int count = ::hifi::qt::getEventQueueSize(QThread::currentThread()); if (count > 400) { From a7595496f63dda8d01fd3e24326a94b17954a0ff Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Tue, 14 May 2019 16:39:39 -0700 Subject: [PATCH 4/4] CR fixes --- assignment-client/src/audio/AudioMixerSlavePool.cpp | 2 +- assignment-client/src/audio/AudioMixerSlavePool.h | 2 +- assignment-client/src/avatars/AvatarMixerSlavePool.cpp | 2 +- assignment-client/src/avatars/AvatarMixerSlavePool.h | 2 +- interface/resources/qml/Stats.qml | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/assignment-client/src/audio/AudioMixerSlavePool.cpp b/assignment-client/src/audio/AudioMixerSlavePool.cpp index 16cfa8217b..5f6936cb2d 100644 --- a/assignment-client/src/audio/AudioMixerSlavePool.cpp +++ b/assignment-client/src/audio/AudioMixerSlavePool.cpp @@ -114,7 +114,7 @@ void AudioMixerSlavePool::each(std::function funct } #ifdef DEBUG_EVENT_QUEUE -void AudioMixerSlavePool::queueStats(QJsonObject & stats) { +void AudioMixerSlavePool::queueStats(QJsonObject& stats) { unsigned i = 0; for (auto& slave : _slaves) { int queueSize = ::hifi::qt::getEventQueueSize(slave.get()); diff --git a/assignment-client/src/audio/AudioMixerSlavePool.h b/assignment-client/src/audio/AudioMixerSlavePool.h index efb9c920d9..3807db0541 100644 --- a/assignment-client/src/audio/AudioMixerSlavePool.h +++ b/assignment-client/src/audio/AudioMixerSlavePool.h @@ -73,7 +73,7 @@ public: void each(std::function functor); #ifdef DEBUG_EVENT_QUEUE - void queueStats(QJsonObject & stats); + void queueStats(QJsonObject& stats); #endif void setNumThreads(int numThreads); diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp index e92b09bc07..027e68e88b 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp @@ -118,7 +118,7 @@ void AvatarMixerSlavePool::each(std::function fun } #ifdef DEBUG_EVENT_QUEUE -void AvatarMixerSlavePool::queueStats(QJsonObject & stats) { +void AvatarMixerSlavePool::queueStats(QJsonObject& stats) { unsigned i = 0; for (auto& slave : _slaves) { int queueSize = ::hifi::qt::getEventQueueSize(slave.get()); diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.h b/assignment-client/src/avatars/AvatarMixerSlavePool.h index 9a8105eac1..c8f4c252b1 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.h +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.h @@ -75,7 +75,7 @@ public: void each(std::function functor); #ifdef DEBUG_EVENT_QUEUE - void AvatarMixerSlavePool::queueStats(QJsonObject & stats); + void AvatarMixerSlavePool::queueStats(QJsonObject& stats); #endif void setNumThreads(int numThreads); diff --git a/interface/resources/qml/Stats.qml b/interface/resources/qml/Stats.qml index 1180a952c3..5af3ba9168 100644 --- a/interface/resources/qml/Stats.qml +++ b/interface/resources/qml/Stats.qml @@ -149,12 +149,13 @@ Item { } StatText { visible: { root.eventQueueDebuggingOn && root.expanded } - text: { if (root.eventQueueDebuggingOn) + text: { if (root.eventQueueDebuggingOn) { return "Event Queue Depth\n " + "Main:\t" + root.mainThreadQueueDepth + "\n" + "NodeList:\t" + root.nodeListThreadQueueDepth; - else + } else { return ""; + } } } }