Skip to content

Commit

Permalink
feat: add RTT to brutal sender debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyxdd committed Oct 7, 2023
1 parent 8942959 commit 5597b48
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/internal/congestion/brutal/brutal.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ func (b *BrutalSender) updateAckRate(currentTimestamp int64) {
b.ackRate = 1
if b.canPrintAckRate(currentTimestamp) {
b.lastAckPrintTimestamp = currentTimestamp
b.debugPrint("Not enough samples (total=%d, ack=%d, loss=%d)", ackCount+lossCount, ackCount, lossCount)
b.debugPrint("Not enough samples (total=%d, ack=%d, loss=%d, rtt=%d)",
ackCount+lossCount, ackCount, lossCount, b.rttStats.SmoothedRTT().Milliseconds())
}
return
}
Expand All @@ -143,14 +144,16 @@ func (b *BrutalSender) updateAckRate(currentTimestamp int64) {
b.ackRate = minAckRate
if b.canPrintAckRate(currentTimestamp) {
b.lastAckPrintTimestamp = currentTimestamp
b.debugPrint("ACK rate too low: %.2f, clamped to %.2f (total=%d, ack=%d, loss=%d)", rate, minAckRate, ackCount+lossCount, ackCount, lossCount)
b.debugPrint("ACK rate too low: %.2f, clamped to %.2f (total=%d, ack=%d, loss=%d, rtt=%d)",
rate, minAckRate, ackCount+lossCount, ackCount, lossCount, b.rttStats.SmoothedRTT().Milliseconds())
}
return
}
b.ackRate = rate
if b.canPrintAckRate(currentTimestamp) {
b.lastAckPrintTimestamp = currentTimestamp
b.debugPrint("ACK rate: %.2f (total=%d, ack=%d, loss=%d)", rate, ackCount+lossCount, ackCount, lossCount)
b.debugPrint("ACK rate: %.2f (total=%d, ack=%d, loss=%d, rtt=%d)",
rate, ackCount+lossCount, ackCount, lossCount, b.rttStats.SmoothedRTT().Milliseconds())
}
}

Expand Down

0 comments on commit 5597b48

Please sign in to comment.