Refactor NACK tracking in stream allocator (#1623)

* log some NACKs

* split out NACK tracker

* remove debug
This commit is contained in:
Raja Subramanian
2023-04-17 10:16:12 +05:30
committed by GitHub
parent 0ce3ba418f
commit 5d187523fa
3 changed files with 102 additions and 46 deletions
+2 -5
View File
@@ -781,10 +781,9 @@ func (s *StreamAllocator) handleNewEstimateInNonProbe() {
var estimateToCommit int64
expectedBandwidthUsage := s.getExpectedBandwidthUsage()
packets, repeatedNacks, nackRatio := s.channelObserver.GetNackRatio()
switch reason {
case ChannelCongestionReasonLoss:
estimateToCommit = int64(float64(expectedBandwidthUsage) * (1.0 - NackRatioAttenuator*nackRatio))
estimateToCommit = int64(float64(expectedBandwidthUsage) * (1.0 - NackRatioAttenuator*s.channelObserver.GetNackRatio()))
if estimateToCommit > s.lastReceivedEstimate {
estimateToCommit = s.lastReceivedEstimate
}
@@ -799,9 +798,7 @@ func (s *StreamAllocator) handleNewEstimateInNonProbe() {
"new(bps)", estimateToCommit,
"lastReceived(bps)", s.lastReceivedEstimate,
"expectedUsage(bps)", expectedBandwidthUsage,
"packets", packets,
"repeatedNacks", repeatedNacks,
"nackRatio", nackRatio,
"channel", s.channelObserver.ToString(),
)
s.committedChannelCapacity = estimateToCommit