From 846b2d9c5c729a105e5ddb7266a257556fc3880e Mon Sep 17 00:00:00 2001 From: stefan Date: Fri, 3 Jun 2016 00:20:34 -0700 Subject: [PATCH] Reduce logging frequency in bwe simulations. BUG=webrtc:5962 NOTRY=true Review-Url: https://codereview.webrtc.org/2030903002 Cr-Commit-Position: refs/heads/master@{#13025} --- .../test/estimators/send_side.cc | 9 +++++++-- .../remote_bitrate_estimator/test/estimators/send_side.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc index 111521ea2e..2fa60a104c 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc @@ -28,7 +28,8 @@ FullBweSender::FullBweSender(int kbps, BitrateObserver* observer, Clock* clock) clock_(clock), send_time_history_(clock_, 10000), has_received_ack_(false), - last_acked_seq_num_(0) { + last_acked_seq_num_(0), + last_log_time_ms_(0) { assert(kbps >= kMinBitrateKbps); assert(kbps <= kMaxBitrateKbps); bitrate_controller_->SetStartBitrate(1000 * kbps); @@ -52,7 +53,11 @@ void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { std::vector packet_feedback_vector(fb.packet_feedback_vector()); for (PacketInfo& packet_info : packet_feedback_vector) { if (!send_time_history_.GetInfo(&packet_info, true)) { - LOG(LS_WARNING) << "Ack arrived too late."; + int64_t now_ms = clock_->TimeInMilliseconds(); + if (now_ms - last_log_time_ms_ > 5000) { + LOG(LS_WARNING) << "Ack arrived too late."; + last_log_time_ms_ = now_ms; + } } } diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h index 51e29e34c2..ca7f6dbddc 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h @@ -45,6 +45,7 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver { SendTimeHistory send_time_history_; bool has_received_ack_; uint16_t last_acked_seq_num_; + int64_t last_log_time_ms_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FullBweSender); };