Merge pull request #1901 from lucas-clemente/cleanup-send-algorithm

clean up the congestion interface
This commit is contained in:
Marten Seemann
2019-05-13 16:10:17 +02:00
committed by GitHub
4 changed files with 2 additions and 57 deletions

View File

@@ -63,10 +63,9 @@ type cubicSender struct {
}
var _ SendAlgorithm = &cubicSender{}
var _ SendAlgorithmWithDebugInfo = &cubicSender{}
// NewCubicSender makes a new cubic sender
func NewCubicSender(clock Clock, rttStats *RTTStats, reno bool, initialCongestionWindow, initialMaxCongestionWindow protocol.ByteCount) SendAlgorithmWithDebugInfo {
func NewCubicSender(clock Clock, rttStats *RTTStats, reno bool, initialCongestionWindow, initialMaxCongestionWindow protocol.ByteCount) *cubicSender {
return &cubicSender{
rttStats: rttStats,
initialCongestionWindow: initialCongestionWindow,

View File

@@ -26,7 +26,7 @@ const MaxCongestionWindow protocol.ByteCount = 200 * protocol.DefaultTCPMSS
var _ = Describe("Cubic Sender", func() {
var (
sender SendAlgorithmWithDebugInfo
sender *cubicSender
clock mockClock
bytesInFlight protocol.ByteCount
packetNumber protocol.PacketNumber

View File

@@ -14,23 +14,5 @@ type SendAlgorithm interface {
MaybeExitSlowStart()
OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime time.Time)
OnPacketLost(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount)
SetNumEmulatedConnections(n int)
OnRetransmissionTimeout(packetsRetransmitted bool)
OnConnectionMigration()
// Experiments
SetSlowStartLargeReduction(enabled bool)
}
// SendAlgorithmWithDebugInfo adds some debug functions to SendAlgorithm
type SendAlgorithmWithDebugInfo interface {
SendAlgorithm
BandwidthEstimate() Bandwidth
// Stuff only used in testing
HybridSlowStart() *HybridSlowStart
SlowstartThreshold() protocol.ByteCount
RenoBeta() float32
InRecovery() bool
}

View File

@@ -61,18 +61,6 @@ func (mr *MockSendAlgorithmMockRecorder) MaybeExitSlowStart() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaybeExitSlowStart", reflect.TypeOf((*MockSendAlgorithm)(nil).MaybeExitSlowStart))
}
// OnConnectionMigration mocks base method
func (m *MockSendAlgorithm) OnConnectionMigration() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "OnConnectionMigration")
}
// OnConnectionMigration indicates an expected call of OnConnectionMigration
func (mr *MockSendAlgorithmMockRecorder) OnConnectionMigration() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnConnectionMigration", reflect.TypeOf((*MockSendAlgorithm)(nil).OnConnectionMigration))
}
// OnPacketAcked mocks base method
func (m *MockSendAlgorithm) OnPacketAcked(arg0 protocol.PacketNumber, arg1, arg2 protocol.ByteCount, arg3 time.Time) {
m.ctrl.T.Helper()
@@ -121,30 +109,6 @@ func (mr *MockSendAlgorithmMockRecorder) OnRetransmissionTimeout(arg0 interface{
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnRetransmissionTimeout", reflect.TypeOf((*MockSendAlgorithm)(nil).OnRetransmissionTimeout), arg0)
}
// SetNumEmulatedConnections mocks base method
func (m *MockSendAlgorithm) SetNumEmulatedConnections(arg0 int) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetNumEmulatedConnections", arg0)
}
// SetNumEmulatedConnections indicates an expected call of SetNumEmulatedConnections
func (mr *MockSendAlgorithmMockRecorder) SetNumEmulatedConnections(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetNumEmulatedConnections", reflect.TypeOf((*MockSendAlgorithm)(nil).SetNumEmulatedConnections), arg0)
}
// SetSlowStartLargeReduction mocks base method
func (m *MockSendAlgorithm) SetSlowStartLargeReduction(arg0 bool) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "SetSlowStartLargeReduction", arg0)
}
// SetSlowStartLargeReduction indicates an expected call of SetSlowStartLargeReduction
func (mr *MockSendAlgorithmMockRecorder) SetSlowStartLargeReduction(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSlowStartLargeReduction", reflect.TypeOf((*MockSendAlgorithm)(nil).SetSlowStartLargeReduction), arg0)
}
// TimeUntilSend mocks base method
func (m *MockSendAlgorithm) TimeUntilSend(arg0 protocol.ByteCount) time.Duration {
m.ctrl.T.Helper()