Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: net/quic/congestion_control/send_algorithm_simulator.cc

Issue 399763004: QUIC test only change to add track the observed loss rate in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/send_algorithm_simulator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/send_algorithm_simulator.cc
diff --git a/net/quic/congestion_control/send_algorithm_simulator.cc b/net/quic/congestion_control/send_algorithm_simulator.cc
index 2e6bb23ad22d1ddb7033810b712cb8f7afddaac0..5c55f5b5d69d225486d7daefe22ba0592924bc76 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.cc
+++ b/net/quic/congestion_control/send_algorithm_simulator.cc
@@ -34,7 +34,8 @@ SendAlgorithmSimulator::Sender::Sender(SendAlgorithmInterface* send_algorithm,
min_cwnd(100000),
max_cwnd_drop(0),
last_cwnd(0),
- last_transfer_bandwidth(QuicBandwidth::Zero()) {}
+ last_transfer_bandwidth(QuicBandwidth::Zero()),
+ last_transfer_loss_rate(0) {}
SendAlgorithmSimulator::SendAlgorithmSimulator(
MockClock* clock,
@@ -268,10 +269,13 @@ void SendAlgorithmSimulator::HandlePendingAck(Transfer* transfer) {
sender->RecordStats();
transfer->bytes_acked += acked_packets.size() * kPacketSize;
+ transfer->bytes_lost += lost_packets.size() * kPacketSize;
if (transfer->bytes_acked >= transfer->num_bytes) {
// Remove completed transfers and record transfer bandwidth.
QuicTime::Delta transfer_time =
clock_->Now().Subtract(transfer->start_time);
+ sender->last_transfer_loss_rate = static_cast<float>(transfer->bytes_lost) /
+ (transfer->bytes_lost + transfer->bytes_acked);
sender->last_transfer_bandwidth =
QuicBandwidth::FromBytesAndTimeDelta(transfer->num_bytes,
transfer_time);
« no previous file with comments | « net/quic/congestion_control/send_algorithm_simulator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698