Printing internal state of GoogCC.
This is useful for debugging and has minimal effect on production code. Bug: webrtc:9510 Change-Id: I3a71f484a0d4e54999e376b7924b73230d86cd96 Reviewed-on: https://webrtc-review.googlesource.com/97607 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24557}
This commit is contained in:
parent
9de4ef4b24
commit
d0e0ec959f
@ -147,6 +147,7 @@ if (rtc_include_tests) {
|
|||||||
"test/goog_cc_printer.h",
|
"test/goog_cc_printer.h",
|
||||||
]
|
]
|
||||||
deps = [
|
deps = [
|
||||||
|
":estimators",
|
||||||
":goog_cc",
|
":goog_cc",
|
||||||
"..:test_controller_printer",
|
"..:test_controller_printer",
|
||||||
]
|
]
|
||||||
|
|||||||
@ -55,6 +55,7 @@ class AlrDetector {
|
|||||||
void UpdateBudgetWithBytesSent(size_t bytes_sent);
|
void UpdateBudgetWithBytesSent(size_t bytes_sent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class GoogCcStatePrinter;
|
||||||
int bandwidth_usage_percent_;
|
int bandwidth_usage_percent_;
|
||||||
int alr_start_budget_level_percent_;
|
int alr_start_budget_level_percent_;
|
||||||
int alr_stop_budget_level_percent_;
|
int alr_stop_budget_level_percent_;
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class DelayBasedBwe {
|
|||||||
int64_t GetExpectedBwePeriodMs() const;
|
int64_t GetExpectedBwePeriodMs() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class GoogCcStatePrinter;
|
||||||
void IncomingPacketFeedback(const PacketFeedback& packet_feedback,
|
void IncomingPacketFeedback(const PacketFeedback& packet_feedback,
|
||||||
int64_t at_time_ms);
|
int64_t at_time_ms);
|
||||||
Result OnLongFeedbackDelay(int64_t arrival_time_ms);
|
Result OnLongFeedbackDelay(int64_t arrival_time_ms);
|
||||||
|
|||||||
@ -52,6 +52,7 @@ class GoogCcNetworkController : public NetworkControllerInterface {
|
|||||||
NetworkControlUpdate GetNetworkState(Timestamp at_time) const;
|
NetworkControlUpdate GetNetworkState(Timestamp at_time) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class GoogCcStatePrinter;
|
||||||
std::vector<ProbeClusterConfig> UpdateBitrateConstraints(
|
std::vector<ProbeClusterConfig> UpdateBitrateConstraints(
|
||||||
TargetRateConstraints constraints,
|
TargetRateConstraints constraints,
|
||||||
absl::optional<DataRate> starting_rate);
|
absl::optional<DataRate> starting_rate);
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#include "modules/congestion_controller/goog_cc/test/goog_cc_printer.h"
|
#include "modules/congestion_controller/goog_cc/test/goog_cc_printer.h"
|
||||||
|
#include "modules/congestion_controller/goog_cc/trendline_estimator.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
GoogCcStatePrinter::GoogCcStatePrinter() = default;
|
GoogCcStatePrinter::GoogCcStatePrinter() = default;
|
||||||
@ -21,10 +23,23 @@ bool GoogCcStatePrinter::Attached() const {
|
|||||||
return controller_ != nullptr;
|
return controller_ != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoogCcStatePrinter::PrintHeaders(FILE* out) {}
|
void GoogCcStatePrinter::PrintHeaders(FILE* out) {
|
||||||
|
fprintf(out,
|
||||||
|
"rate_control_state rate_control_region alr_state"
|
||||||
|
" trendline trendline_modified_offset trendline_offset_threshold");
|
||||||
|
}
|
||||||
|
|
||||||
void GoogCcStatePrinter::PrintValues(FILE* out) {
|
void GoogCcStatePrinter::PrintValues(FILE* out) {
|
||||||
RTC_CHECK(controller_);
|
RTC_CHECK(controller_);
|
||||||
|
auto* detector = controller_->delay_based_bwe_->delay_detector_.get();
|
||||||
|
auto* trendline_estimator = reinterpret_cast<TrendlineEstimator*>(detector);
|
||||||
|
fprintf(out, "%i %i %i %.6lf %.6lf %.6lf",
|
||||||
|
controller_->delay_based_bwe_->rate_control_.rate_control_state_,
|
||||||
|
controller_->delay_based_bwe_->rate_control_.rate_control_region_,
|
||||||
|
controller_->alr_detector_->alr_started_time_ms_.has_value(),
|
||||||
|
trendline_estimator->trendline_,
|
||||||
|
trendline_estimator->prev_modified_offset_,
|
||||||
|
trendline_estimator->threshold_);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkControlUpdate GoogCcStatePrinter::GetState(Timestamp at_time) const {
|
NetworkControlUpdate GoogCcStatePrinter::GetState(Timestamp at_time) const {
|
||||||
|
|||||||
@ -70,6 +70,7 @@ TrendlineEstimator::TrendlineEstimator(size_t window_size,
|
|||||||
k_down_(0.039),
|
k_down_(0.039),
|
||||||
overusing_time_threshold_(kOverUsingTimeThreshold),
|
overusing_time_threshold_(kOverUsingTimeThreshold),
|
||||||
threshold_(12.5),
|
threshold_(12.5),
|
||||||
|
prev_modified_offset_(NAN),
|
||||||
last_update_ms_(-1),
|
last_update_ms_(-1),
|
||||||
prev_offset_(0.0),
|
prev_offset_(0.0),
|
||||||
time_over_using_(-1),
|
time_over_using_(-1),
|
||||||
@ -162,6 +163,7 @@ void TrendlineEstimator::Detect(double offset,
|
|||||||
|
|
||||||
void TrendlineEstimator::UpdateThreshold(double modified_offset,
|
void TrendlineEstimator::UpdateThreshold(double modified_offset,
|
||||||
int64_t now_ms) {
|
int64_t now_ms) {
|
||||||
|
prev_modified_offset_ = modified_offset;
|
||||||
if (last_update_ms_ == -1)
|
if (last_update_ms_ == -1)
|
||||||
last_update_ms_ = now_ms;
|
last_update_ms_ = now_ms;
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ class TrendlineEstimator : public DelayIncreaseDetectorInterface {
|
|||||||
unsigned int num_of_deltas() const { return num_of_deltas_; }
|
unsigned int num_of_deltas() const { return num_of_deltas_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class GoogCcStatePrinter;
|
||||||
void Detect(double offset,
|
void Detect(double offset,
|
||||||
double ts_delta,
|
double ts_delta,
|
||||||
int num_of_deltas,
|
int num_of_deltas,
|
||||||
@ -79,6 +80,7 @@ class TrendlineEstimator : public DelayIncreaseDetectorInterface {
|
|||||||
const double k_down_;
|
const double k_down_;
|
||||||
double overusing_time_threshold_;
|
double overusing_time_threshold_;
|
||||||
double threshold_;
|
double threshold_;
|
||||||
|
double prev_modified_offset_;
|
||||||
int64_t last_update_ms_;
|
int64_t last_update_ms_;
|
||||||
double prev_offset_;
|
double prev_offset_;
|
||||||
double time_over_using_;
|
double time_over_using_;
|
||||||
|
|||||||
@ -54,6 +54,7 @@ class AimdRateControl {
|
|||||||
int GetExpectedBandwidthPeriodMs() const;
|
int GetExpectedBandwidthPeriodMs() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
friend class GoogCcStatePrinter;
|
||||||
// Update the target bitrate based on, among other things, the current rate
|
// Update the target bitrate based on, among other things, the current rate
|
||||||
// control state, the current target bitrate and the estimated throughput.
|
// control state, the current target bitrate and the estimated throughput.
|
||||||
// When in the "increase" state the bitrate will be increased either
|
// When in the "increase" state the bitrate will be increased either
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user