introduce separate congestion debug interface to simplify mocking

This commit is contained in:
Lucas Clemente
2016-05-08 17:53:46 +02:00
parent dbcf5b8cce
commit db5e8f507e
3 changed files with 8 additions and 3 deletions

View File

@@ -11,7 +11,6 @@ type SendAlgorithm interface {
OnPacketSent(sentTime time.Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool) bool
GetCongestionWindow() protocol.ByteCount
OnCongestionEvent(rttUpdated bool, bytesInFlight protocol.ByteCount, ackedPackets PacketVector, lostPackets PacketVector)
BandwidthEstimate() Bandwidth
SetNumEmulatedConnections(n int)
OnRetransmissionTimeout(packetsRetransmitted bool)
OnConnectionMigration()
@@ -19,9 +18,15 @@ type SendAlgorithm interface {
// Experiments
SetSlowStartLargeReduction(enabled bool)
}
type SendAlgorithmWithDebugInfo interface {
SendAlgorithm
BandwidthEstimate() Bandwidth
// Stuff only used in testing
// TODO: Maybe make CubicSender public and typeassert in tests?
HybridSlowStart() *HybridSlowStart
SlowstartThreshold() protocol.PacketNumber
RenoBeta() float32