From 6c4ba9f77dd2b013d9e252a4fe7560b6c8380f0d Mon Sep 17 00:00:00 2001 From: terelius Date: Wed, 14 Jun 2017 02:41:59 -0700 Subject: [PATCH] Plot acknowledged bitrate when compiled with rtc_enable_bwe_test_logging. Change plotting of detector state from offset and gamma to T and threshold. BUG=None Review-Url: https://codereview.webrtc.org/2933243003 Cr-Commit-Position: refs/heads/master@{#18585} --- .../congestion_controller/acknowledge_bitrate_estimator.cc | 3 +++ webrtc/modules/remote_bitrate_estimator/overuse_detector.cc | 4 ++-- .../modules/remote_bitrate_estimator/test/plot_dynamics.py | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.cc b/webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.cc index 9df378c64b..3fa3ac9995 100644 --- a/webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.cc +++ b/webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.cc @@ -12,6 +12,7 @@ #include +#include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" namespace webrtc { @@ -73,6 +74,8 @@ void AcknowledgedBitrateEstimator::Update(int64_t now_ms, int bytes) { (sample_var + pred_bitrate_estimate_var); bitrate_estimate_var_ = sample_var * pred_bitrate_estimate_var / (sample_var + pred_bitrate_estimate_var); + BWE_TEST_LOGGING_PLOT(1, "acknowledged_bitrate", now_ms, + bitrate_estimate_ * 1000); } float AcknowledgedBitrateEstimator::UpdateWindow(int64_t now_ms, diff --git a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc index 6b2b518375..879cd28afc 100644 --- a/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc +++ b/webrtc/modules/remote_bitrate_estimator/overuse_detector.cc @@ -90,8 +90,8 @@ BandwidthUsage OveruseDetector::Detect(double offset, return BandwidthUsage::kBwNormal; } const double T = std::min(num_of_deltas, kMinNumDeltas) * offset; - BWE_TEST_LOGGING_PLOT(1, "offset_ms#1", now_ms, offset); - BWE_TEST_LOGGING_PLOT(1, "gamma_ms#1", now_ms, threshold_ / kMinNumDeltas); + BWE_TEST_LOGGING_PLOT(1, "T", now_ms, T); + BWE_TEST_LOGGING_PLOT(1, "threshold", now_ms, threshold_); if (T > threshold_) { if (time_over_using_ == -1) { // Initialize the timer. Assume that we've been diff --git a/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py b/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py index 51ef06ef0a..51aca1cf4c 100755 --- a/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py +++ b/webrtc/modules/remote_bitrate_estimator/test/plot_dynamics.py @@ -137,8 +137,7 @@ def main(): kalman_state.AddSubplot(['var_noise'], "Time (s)", "Var noise") detector_state = Figure("DetectorState") - detector_state.AddSubplot(['offset_ms'], "Time (s)", "Offset") - detector_state.AddSubplot(['gamma_ms'], "Time (s)", "Gamma") + detector_state.AddSubplot(['T', 'threshold'], "Time (s)", "Offset") trendline_state = Figure("TrendlineState") trendline_state.AddSubplot(["accumulated_delay_ms", "smoothed_delay_ms"], @@ -146,7 +145,8 @@ def main(): trendline_state.AddSubplot(["trendline_slope"], "Time (s)", "Slope") target_bitrate = Figure("TargetBitrate") - target_bitrate.AddSubplot(['target_bitrate_bps'], "Time (s)", "Bitrate (bps)") + target_bitrate.AddSubplot(['target_bitrate_bps', 'acknowledged_bitrate'], + "Time (s)", "Bitrate (bps)") # Select which figures to plot here. figures = [receiver, detector_state, trendline_state, target_bitrate]