From b06b358207054de346351e3bd3180db6fff0bf04 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Mon, 16 Oct 2017 17:59:12 +0200 Subject: [PATCH] Update aggregating interval in getStats for receive side. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now some metrics would be aggregated over 1s window instead of 10s. Bug: webrtc:8402 Change-Id: If0b5a70257c767a1741b451585f3da501b903374 Reviewed-on: https://webrtc-review.googlesource.com/11400 Commit-Queue: Ilya Nikolaevskiy Reviewed-by: Erik Språng Cr-Commit-Position: refs/heads/master@{#20316} --- video/receive_statistics_proxy.cc | 4 +++- video/receive_statistics_proxy_unittest.cc | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc index d4bdc6d274..10b200be1f 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -45,7 +45,9 @@ const int kLowVarianceThreshold = 1; const int kHighVarianceThreshold = 2; // Some metrics are reported as a maximum over this period. -const int kMovingMaxWindowMs = 10000; +// This should be synchronized with a typical getStats polling interval in +// the clients. +const int kMovingMaxWindowMs = 1000; // How large window we use to calculate the framerate/bitrate. const int kRateStatisticsWindowSizeMs = 1000; diff --git a/video/receive_statistics_proxy_unittest.cc b/video/receive_statistics_proxy_unittest.cc index 83dffb7fcd..44fdc8bd15 100644 --- a/video/receive_statistics_proxy_unittest.cc +++ b/video/receive_statistics_proxy_unittest.cc @@ -144,9 +144,9 @@ TEST_F(ReceiveStatisticsProxyTest, ReportsMaxInterframeDelay) { } TEST_F(ReceiveStatisticsProxyTest, ReportInterframeDelayInWindow) { - const int64_t kInterframeDelayMs1 = 9000; - const int64_t kInterframeDelayMs2 = 7500; - const int64_t kInterframeDelayMs3 = 7000; + const int64_t kInterframeDelayMs1 = 900; + const int64_t kInterframeDelayMs2 = 750; + const int64_t kInterframeDelayMs3 = 700; EXPECT_EQ(-1, statistics_proxy_->GetStats().interframe_delay_max_ms); statistics_proxy_->OnDecodedFrame(rtc::Optional(3u), VideoContentType::UNSPECIFIED);