Move RtcEventProbeClusterCreated to the network controller.
Originally RtcEventProbeClusterCreated was logged in bitrate prober. This means that anyone who was using GoogCcNetworkControl wasn't logging it, and the NetworkControl wasn't self-contained. This changes moves the responsibility for logging ProbeClusterCreated to ProbeController (where the probe is created), it also moves the responsibility for assigning probe ids to the probe controller. Bug: None Change-Id: If0433cc6d311b5483ea3980749b03ddbcd2bf041 Reviewed-on: https://webrtc-review.googlesource.com/c/122927 Commit-Queue: Peter Slatala <psla@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26713}
This commit is contained in:
committed by
Commit Bot
parent
6255af99a8
commit
c39f462b2d
@ -170,12 +170,14 @@ rtc_source_set("probe_controller") {
|
||||
"../../../api/units:data_rate",
|
||||
"../../../api/units:time_delta",
|
||||
"../../../api/units:timestamp",
|
||||
"../../../logging:rtc_event_bwe",
|
||||
"../../../logging:rtc_event_log_api",
|
||||
"../../../logging:rtc_event_pacing",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/system:unused",
|
||||
"../../../system_wrappers:metrics",
|
||||
"//third_party/abseil-cpp/absl/memory:memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ GoogCcNetworkController::GoogCcNetworkController(RtcEventLog* event_log,
|
||||
.find("Enabled") == 0),
|
||||
rate_control_settings_(
|
||||
RateControlSettings::ParseFromKeyValueConfig(key_value_config_)),
|
||||
probe_controller_(new ProbeController(key_value_config_)),
|
||||
probe_controller_(new ProbeController(key_value_config_, event_log)),
|
||||
congestion_window_pushback_controller_(
|
||||
rate_control_settings_.UseCongestionWindowPushback()
|
||||
? absl::make_unique<CongestionWindowPushbackController>(
|
||||
|
||||
@ -13,10 +13,12 @@
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
#include "absl/memory/memory.h"
|
||||
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_cluster_created.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
@ -80,16 +82,32 @@ constexpr char kBweRapidRecoveryExperiment[] =
|
||||
// Never probe higher than configured by OnMaxTotalAllocatedBitrate().
|
||||
constexpr char kCappedProbingFieldTrialName[] = "WebRTC-BweCappedProbing";
|
||||
|
||||
void MaybeLogProbeClusterCreated(RtcEventLog* event_log,
|
||||
const ProbeClusterConfig& probe) {
|
||||
RTC_DCHECK(event_log);
|
||||
if (!event_log) {
|
||||
return;
|
||||
}
|
||||
|
||||
size_t min_bytes = static_cast<int32_t>(probe.target_data_rate.bps() *
|
||||
probe.target_duration.ms() / 8000);
|
||||
event_log->Log(absl::make_unique<RtcEventProbeClusterCreated>(
|
||||
probe.id, probe.target_data_rate.bps(), probe.target_probe_count,
|
||||
min_bytes));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ProbeController::ProbeController(const WebRtcKeyValueConfig* key_value_config)
|
||||
ProbeController::ProbeController(const WebRtcKeyValueConfig* key_value_config,
|
||||
RtcEventLog* event_log)
|
||||
: enable_periodic_alr_probing_(false),
|
||||
in_rapid_recovery_experiment_(
|
||||
key_value_config->Lookup(kBweRapidRecoveryExperiment)
|
||||
.find("Enabled") == 0),
|
||||
limit_probes_with_allocateable_rate_(
|
||||
key_value_config->Lookup(kCappedProbingFieldTrialName)
|
||||
.find("Disabled") != 0) {
|
||||
.find("Disabled") != 0),
|
||||
event_log_(event_log) {
|
||||
Reset(0);
|
||||
}
|
||||
|
||||
@ -364,6 +382,9 @@ std::vector<ProbeClusterConfig> ProbeController::InitiateProbing(
|
||||
config.target_data_rate = DataRate::bps(rtc::dchecked_cast<int>(bitrate));
|
||||
config.target_duration = TimeDelta::ms(kMinProbeDurationMs);
|
||||
config.target_probe_count = kMinProbePacketsSent;
|
||||
config.id = next_probe_cluster_id_;
|
||||
next_probe_cluster_id_++;
|
||||
MaybeLogProbeClusterCreated(event_log_, config);
|
||||
pending_probes.push_back(config);
|
||||
}
|
||||
time_last_probing_initiated_ms_ = now_ms;
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#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/system/unused.h"
|
||||
|
||||
@ -31,7 +32,8 @@ class Clock;
|
||||
// bitrate is adjusted by an application.
|
||||
class ProbeController {
|
||||
public:
|
||||
explicit ProbeController(const WebRtcKeyValueConfig* key_value_config);
|
||||
explicit ProbeController(const WebRtcKeyValueConfig* key_value_config,
|
||||
RtcEventLog* event_log);
|
||||
~ProbeController();
|
||||
|
||||
RTC_WARN_UNUSED_RESULT std::vector<ProbeClusterConfig> SetBitrates(
|
||||
@ -112,6 +114,9 @@ class ProbeController {
|
||||
bool mid_call_probing_waiting_for_result_;
|
||||
int64_t mid_call_probing_bitrate_bps_;
|
||||
int64_t mid_call_probing_succcess_threshold_;
|
||||
RtcEventLog* event_log_;
|
||||
|
||||
int32_t next_probe_cluster_id_ = 1;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(ProbeController);
|
||||
};
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "api/transport/network_types.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
|
||||
#include "modules/congestion_controller/goog_cc/probe_controller.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "test/gmock.h"
|
||||
@ -44,7 +45,8 @@ constexpr int kBitrateDropTimeoutMs = 5000;
|
||||
class ProbeControllerTest : public ::testing::Test {
|
||||
protected:
|
||||
ProbeControllerTest() : clock_(100000000L) {
|
||||
probe_controller_.reset(new ProbeController(&field_trial_config_));
|
||||
probe_controller_.reset(
|
||||
new ProbeController(&field_trial_config_, &mock_rtc_event_log));
|
||||
}
|
||||
~ProbeControllerTest() override {}
|
||||
|
||||
@ -59,6 +61,7 @@ class ProbeControllerTest : public ::testing::Test {
|
||||
|
||||
FieldTrialBasedConfig field_trial_config_;
|
||||
SimulatedClock clock_;
|
||||
MockRtcEventLog mock_rtc_event_log;
|
||||
std::unique_ptr<ProbeController> probe_controller_;
|
||||
};
|
||||
|
||||
@ -225,7 +228,8 @@ TEST_F(ProbeControllerTest, PeriodicProbing) {
|
||||
}
|
||||
|
||||
TEST_F(ProbeControllerTest, PeriodicProbingAfterReset) {
|
||||
probe_controller_.reset(new ProbeController(&field_trial_config_));
|
||||
probe_controller_.reset(
|
||||
new ProbeController(&field_trial_config_, &mock_rtc_event_log));
|
||||
int64_t alr_start_time = clock_.TimeInMilliseconds();
|
||||
|
||||
probe_controller_->SetAlrStartTimeMs(alr_start_time);
|
||||
|
||||
Reference in New Issue
Block a user