From 075b8574fb34f3ecee744691c8512555b2c63de5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 18 Aug 2017 11:31:03 -0700 Subject: [PATCH] using 0.0 for time stats is unambiguous --- assignment-client/src/octree/OctreeServer.cpp | 17 +++++------------ assignment-client/src/octree/OctreeServer.h | 2 -- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index db97da751f..227f9599e3 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -37,8 +37,6 @@ int OctreeServer::_clientCount = 0; const int MOVING_AVERAGE_SAMPLE_COUNTS = 1000000; -float OctreeServer::SKIP_TIME = -1.0f; // use this for trackXXXTime() calls for non-times - SimpleMovingAverage OctreeServer::_averageLoopTime(MOVING_AVERAGE_SAMPLE_COUNTS); SimpleMovingAverage OctreeServer::_averageInsideTime(MOVING_AVERAGE_SAMPLE_COUNTS); @@ -134,9 +132,8 @@ void OctreeServer::trackEncodeTime(float time) { const float MAX_SHORT_TIME = 10.0f; const float MAX_LONG_TIME = 100.0f; - if (time == SKIP_TIME) { + if (time == 0.0f) { _noEncode++; - time = 0.0f; } else if (time <= MAX_SHORT_TIME) { _shortEncode++; _averageShortEncodeTime.updateAverage(time); @@ -153,9 +150,8 @@ void OctreeServer::trackEncodeTime(float time) { void OctreeServer::trackTreeWaitTime(float time) { const float MAX_SHORT_TIME = 10.0f; const float MAX_LONG_TIME = 100.0f; - if (time == SKIP_TIME) { + if (time == 0.0f) { _noTreeWait++; - time = 0.0f; } else if (time <= MAX_SHORT_TIME) { _shortTreeWait++; _averageTreeShortWaitTime.updateAverage(time); @@ -172,9 +168,8 @@ void OctreeServer::trackTreeWaitTime(float time) { void OctreeServer::trackCompressAndWriteTime(float time) { const float MAX_SHORT_TIME = 10.0f; const float MAX_LONG_TIME = 100.0f; - if (time == SKIP_TIME) { + if (time == 0.0f) { _noCompress++; - time = 0.0f; } else if (time <= MAX_SHORT_TIME) { _shortCompress++; _averageShortCompressTime.updateAverage(time); @@ -189,9 +184,8 @@ void OctreeServer::trackCompressAndWriteTime(float time) { } void OctreeServer::trackPacketSendingTime(float time) { - if (time == SKIP_TIME) { + if (time == 0.0f) { _noSend++; - time = 0.0f; } _averagePacketSendingTime.updateAverage(time); } @@ -200,9 +194,8 @@ void OctreeServer::trackPacketSendingTime(float time) { void OctreeServer::trackProcessWaitTime(float time) { const float MAX_SHORT_TIME = 10.0f; const float MAX_LONG_TIME = 100.0f; - if (time == SKIP_TIME) { + if (time == 0.0f) { _noProcessWait++; - time = 0.0f; } else if (time <= MAX_SHORT_TIME) { _shortProcessWait++; _averageProcessShortWaitTime.updateAverage(time); diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index 5043ea681c..ab2ef30da1 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -82,8 +82,6 @@ public: virtual void trackSend(const QUuid& dataID, quint64 dataLastEdited, const QUuid& viewerNode) { } virtual void trackViewerGone(const QUuid& viewerNode) { } - static float SKIP_TIME; // use this for trackXXXTime() calls for non-times - static void trackLoopTime(float time) { _averageLoopTime.updateAverage(time); } static float getAverageLoopTime() { return _averageLoopTime.getAverage(); }