diff --git a/examples/example/misc/collectHifiStats.js b/examples/example/misc/collectHifiStats.js index 3902622217..8501fbb057 100644 --- a/examples/example/misc/collectHifiStats.js +++ b/examples/example/misc/collectHifiStats.js @@ -90,4 +90,5 @@ function sendBatchToEndpoint(batch) { var req = new XMLHttpRequest(); req.open("POST", ENDPOINT_URL, false); req.send(JSON.stringify(batch)); -} \ No newline at end of file + batch = []; +} diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index ebce4f2b96..831664e3e6 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -46,6 +46,7 @@ Stats::Stats(QQuickItem* parent) : QQuickItem(parent) { INSTANCE = this; const QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont); _monospaceFont = font.family(); + _audioStats = &DependencyManager::get()->getStats(); } bool Stats::includeTimingRecord(const QString& name) { diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 2e4c5e4dca..d6aa255dc6 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -12,6 +12,7 @@ #include #include #include +#include #define STATS_PROPERTY(type, name, initialValue) \ Q_PROPERTY(type name READ name NOTIFY name##Changed) \ @@ -27,6 +28,8 @@ class Stats : public QQuickItem { Q_PROPERTY(bool expanded READ isExpanded WRITE setExpanded NOTIFY expandedChanged) Q_PROPERTY(bool timingExpanded READ isTimingExpanded NOTIFY timingExpandedChanged) Q_PROPERTY(QString monospaceFont READ monospaceFont CONSTANT) + Q_PROPERTY(float audioPacketlossUpstream READ getAudioPacketLossUpstream) + Q_PROPERTY(float audioPacketlossDownstream READ getAudioPacketLossDownstream) STATS_PROPERTY(int, serverCount, 0) STATS_PROPERTY(int, framerate, 0) @@ -81,6 +84,10 @@ public: const QString& monospaceFont() { return _monospaceFont; } + + float getAudioPacketLossUpstream() { return _audioStats->getMixerAvatarStreamStats()._packetStreamStats.getLostRate(); } + float getAudioPacketLossDownstream() { return _audioStats->getMixerDownstreamStats()._packetStreamStats.getLostRate(); } + void updateStats(bool force = false); bool isExpanded() { return _expanded; } @@ -149,6 +156,7 @@ private: bool _expanded{ false }; bool _timingExpanded{ false }; QString _monospaceFont; + const AudioIOStats* _audioStats; }; #endif // hifi_Stats_h diff --git a/libraries/gpu/src/gpu/GLBackend.cpp b/libraries/gpu/src/gpu/GLBackend.cpp index 85381a3640..250fc4aaac 100644 --- a/libraries/gpu/src/gpu/GLBackend.cpp +++ b/libraries/gpu/src/gpu/GLBackend.cpp @@ -418,7 +418,7 @@ void GLBackend::resetStages() { #define DO_IT_NOW(call, offset) void Batch::_glActiveBindTexture(GLenum unit, GLenum target, GLuint texture) { - // clean the cache on the texture unit we are going to use + // clean the cache on the texture unit we are going to use so the next call to setResourceTexture() at the same slot works fine setResourceTexture(unit - GL_TEXTURE0, nullptr); ADD_COMMAND_GL(glActiveBindTexture);