Enable configuring probes via field trial.

This CL adds a field trial that lets us control the size of the initial probes, how we grow the following probes and how big and frequent our ALR probes are.

Bug: webrtc:10394
Change-Id: I6c7783dfada9aaf55cd836dd8991bb7b8ca4993b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126880
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27077}
This commit is contained in:
Jonas Olsson
2019-03-12 13:49:26 +01:00
committed by Commit Bot
parent cb96809e46
commit e096004745
4 changed files with 101 additions and 33 deletions

View File

@ -21,12 +21,34 @@
#include "api/transport/webrtc_key_value_config.h"
#include "logging/rtc_event_log/rtc_event_log.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/system/unused.h"
namespace webrtc {
class Clock;
struct ProbeControllerConfig {
explicit ProbeControllerConfig(const WebRtcKeyValueConfig* key_value_config);
ProbeControllerConfig(const ProbeControllerConfig&);
ProbeControllerConfig& operator=(const ProbeControllerConfig&) = default;
~ProbeControllerConfig();
// These parameters configure the initial probes. First we send one or two
// probes of sizes p1 * start_bitrate_bps_ and p2 * start_bitrate_bps_.
// Then whenever we get a bitrate estimate of at least further_probe_threshold
// times the size of the last sent probe we'll send another one of size
// step_size times the new estimate.
FieldTrialParameter<double> first_exponential_probe_scale_;
FieldTrialOptional<double> second_exponential_probe_scale_;
FieldTrialParameter<double> further_exponential_probe_scale_;
FieldTrialParameter<double> further_probe_threshold;
// Configures how often we send ALR probes and how big they are.
FieldTrialParameter<TimeDelta> alr_probing_interval_;
FieldTrialParameter<double> alr_probe_scale_;
};
// This class controls initiation of probing to estimate initial channel
// capacity. There is also support for probing during a session when max
// bitrate is adjusted by an application.
@ -63,9 +85,6 @@ class ProbeController {
RTC_WARN_UNUSED_RESULT std::vector<ProbeClusterConfig> RequestProbe(
int64_t at_time_ms);
RTC_WARN_UNUSED_RESULT std::vector<ProbeClusterConfig>
InitiateCapacityProbing(int64_t bitrate_bps, int64_t at_time_ms);
// Sets a new maximum probing bitrate, without generating a new probe cluster.
void SetMaxBitrate(int64_t max_bitrate_bps);
@ -90,7 +109,7 @@ class ProbeController {
InitiateExponentialProbing(int64_t at_time_ms);
RTC_WARN_UNUSED_RESULT std::vector<ProbeClusterConfig> InitiateProbing(
int64_t now_ms,
std::initializer_list<int64_t> bitrates_to_probe,
std::vector<int64_t> bitrates_to_probe,
bool probe_further);
bool network_available_;
@ -118,6 +137,8 @@ class ProbeController {
int32_t next_probe_cluster_id_ = 1;
ProbeControllerConfig config_;
RTC_DISALLOW_COPY_AND_ASSIGN(ProbeController);
};