Make the acceptable queue in the cwnd experiment configurable.

BUG=webrtc:7926

Review-Url: https://codereview.webrtc.org/2998753002
Cr-Commit-Position: refs/heads/master@{#19320}
This commit is contained in:
stefan 2017-08-11 01:23:54 -07:00 committed by Commit Bot
parent 42f1d6e23a
commit 7c83c56b6d
3 changed files with 27 additions and 4 deletions

View File

@ -160,7 +160,8 @@ class SendSideCongestionController : public CallStatsObserver,
rtc::CriticalSection bwe_lock_;
int min_bitrate_bps_ GUARDED_BY(bwe_lock_);
std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_);
const bool in_cwnd_experiment_;
bool in_cwnd_experiment_;
int64_t accepted_queue_ms_;
bool was_in_alr_;
rtc::RaceChecker worker_race_;

View File

@ -20,6 +20,7 @@
#include "webrtc/modules/pacing/alr_detector.h"
#include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h"
#include "webrtc/rtc_base/checks.h"
#include "webrtc/rtc_base/format_macros.h"
#include "webrtc/rtc_base/logging.h"
#include "webrtc/rtc_base/ptr_util.h"
#include "webrtc/rtc_base/rate_limiter.h"
@ -31,6 +32,7 @@ namespace webrtc {
namespace {
const char kCwndExperiment[] = "WebRTC-CwndExperiment";
const int64_t kDefaultAcceptedQueueMs = 250;
bool CwndExperimentEnabled() {
std::string experiment_string =
@ -39,6 +41,20 @@ bool CwndExperimentEnabled() {
return experiment_string.find("Enabled") == 0;
}
bool ReadCwndExperimentParameter(int64_t* accepted_queue_ms) {
RTC_DCHECK(accepted_queue_ms);
std::string experiment_string =
webrtc::field_trial::FindFullName(kCwndExperiment);
int parsed_values =
sscanf(experiment_string.c_str(), "Enabled-%" PRId64, accepted_queue_ms);
if (parsed_values == 1) {
RTC_CHECK_GE(*accepted_queue_ms, 0)
<< "Accepted must be greater than or equal to 0.";
return true;
}
return false;
}
static const int64_t kRetransmitWindowSizeMs = 500;
// Makes sure that the bitrate and the min, max values are in valid range.
@ -115,8 +131,15 @@ SendSideCongestionController::SendSideCongestionController(
min_bitrate_bps_(congestion_controller::GetMinBitrateBps()),
delay_based_bwe_(new DelayBasedBwe(event_log_, clock_)),
in_cwnd_experiment_(CwndExperimentEnabled()),
accepted_queue_ms_(kDefaultAcceptedQueueMs),
was_in_alr_(0) {
delay_based_bwe_->SetMinBitrate(min_bitrate_bps_);
if (in_cwnd_experiment_ &&
!ReadCwndExperimentParameter(&accepted_queue_ms_)) {
LOG(LS_WARNING) << "Failed to parse parameters for CwndExperiment "
"from field trial string. Experiment disabled.";
in_cwnd_experiment_ = false;
}
}
SendSideCongestionController::~SendSideCongestionController() {}
@ -344,10 +367,9 @@ void SendSideCongestionController::LimitOutstandingBytes(
// we don't try to limit the outstanding packets.
if (!min_rtt_ms)
return;
const int64_t kAcceptedQueueMs = 250;
const size_t kMinCwndBytes = 2 * 1500;
size_t max_outstanding_bytes =
std::max<size_t>((*min_rtt_ms + kAcceptedQueueMs) *
std::max<size_t>((*min_rtt_ms + accepted_queue_ms_) *
last_reported_bitrate_bps_ / 1000 / 8,
kMinCwndBytes);
LOG(LS_INFO) << clock_->TimeInMilliseconds()

View File

@ -1930,7 +1930,7 @@ TEST_F(EndToEndTest, AudioVideoReceivesTransportFeedback) {
TEST_F(EndToEndTest, StopsSendingMediaWithoutFeedback) {
test::ScopedFieldTrials override_field_trials(
"WebRTC-CwndExperiment/Enabled/");
"WebRTC-CwndExperiment/Enabled-250/");
class TransportFeedbackTester : public test::EndToEndTest {
public: