gfe-relnote: (n/a) Add some log for QUIC bbr2 code. Logging only.
PiperOrigin-RevId: 279745573
Change-Id: Ic06947715a4ca42c04384e7c0ab5e951c7a8db95
diff --git a/quic/core/congestion_control/bbr2_probe_rtt.cc b/quic/core/congestion_control/bbr2_probe_rtt.cc
index fe4506b..f9c7709 100644
--- a/quic/core/congestion_control/bbr2_probe_rtt.cc
+++ b/quic/core/congestion_control/bbr2_probe_rtt.cc
@@ -26,6 +26,12 @@
congestion_event.bytes_in_flight <=
sender_->GetMinimumCongestionWindow()) {
exit_time_ = congestion_event.event_time + Params().probe_rtt_duration;
+ QUIC_DVLOG(2) << sender_ << " PROBE_RTT exit time set to " << exit_time_
+ << ". bytes_inflight:" << congestion_event.bytes_in_flight
+ << ", inflight_target:" << InflightTarget()
+ << ", min_congestion_window:"
+ << sender_->GetMinimumCongestionWindow() << " @ "
+ << congestion_event.event_time;
}
return Bbr2Mode::PROBE_RTT;
}
diff --git a/quic/core/congestion_control/bbr2_simulator_test.cc b/quic/core/congestion_control/bbr2_simulator_test.cc
index b2b4d9b..85136bb 100644
--- a/quic/core/congestion_control/bbr2_simulator_test.cc
+++ b/quic/core/congestion_control/bbr2_simulator_test.cc
@@ -135,9 +135,13 @@
~Bbr2DefaultTopologyTest() {
const auto* test_info =
::testing::UnitTest::GetInstance()->current_test_info();
+ const Bbr2Sender::DebugState& debug_state = sender_->ExportDebugState();
QUIC_LOG(INFO) << "Bbr2DefaultTopologyTest." << test_info->name()
<< " completed at simulated time: "
- << SimulatedNow().ToDebuggingValue() / 1e6 << " sec.";
+ << SimulatedNow().ToDebuggingValue() / 1e6
+ << " sec. packet loss:"
+ << sender_loss_rate_in_packets() * 100
+ << "%, bw_hi:" << debug_state.bandwidth_hi;
}
Bbr2Sender* SetupBbr2Sender(simulator::QuicEndpoint* endpoint) {
@@ -771,7 +775,17 @@
::testing::UnitTest::GetInstance()->current_test_info();
QUIC_LOG(INFO) << "Bbr2MultiSenderTest." << test_info->name()
<< " completed at simulated time: "
- << SimulatedNow().ToDebuggingValue() / 1e6 << " sec.";
+ << SimulatedNow().ToDebuggingValue() / 1e6
+ << " sec. Per sender stats:";
+ for (size_t i = 0; i < sender_endpoints_.size(); ++i) {
+ QUIC_LOG(INFO) << "sender[" << i << "]: "
+ << sender_connection(i)
+ ->sent_packet_manager()
+ .GetSendAlgorithm()
+ ->GetCongestionControlType()
+ << ", packet_loss:"
+ << 100.0 * sender_loss_rate_in_packets(i) << "%";
+ }
}
Bbr2Sender* SetupBbr2Sender(simulator::QuicEndpoint* endpoint) {
@@ -838,6 +852,19 @@
QuicTime SimulatedNow() const { return simulator_.GetClock()->Now(); }
+ QuicConnection* sender_connection(size_t which) {
+ return sender_endpoints_[which]->connection();
+ }
+
+ const QuicConnectionStats& sender_connection_stats(size_t which) {
+ return sender_connection(which)->GetStats();
+ }
+
+ float sender_loss_rate_in_packets(size_t which) {
+ return static_cast<float>(sender_connection_stats(which).packets_lost) /
+ sender_connection_stats(which).packets_sent;
+ }
+
simulator::Simulator simulator_;
std::vector<std::unique_ptr<simulator::QuicEndpoint>> sender_endpoints_;
std::vector<std::unique_ptr<simulator::QuicEndpoint>> receiver_endpoints_;