cleanup: estimators: simplify blindAdjust
This commit is contained in:
parent
111072dec5
commit
c699e7bec4
|
@ -29,11 +29,7 @@ func (questionSizeEstimator *QuestionSizeEstimator) MinQuestionSize() int {
|
|||
|
||||
func (questionSizeEstimator *QuestionSizeEstimator) blindAdjust() {
|
||||
questionSizeEstimator.Lock()
|
||||
if MaxDNSUDPPacketSize-questionSizeEstimator.minQuestionSize < questionSizeEstimator.minQuestionSize {
|
||||
questionSizeEstimator.minQuestionSize = MaxDNSUDPPacketSize
|
||||
} else {
|
||||
questionSizeEstimator.minQuestionSize *= 2
|
||||
}
|
||||
questionSizeEstimator.minQuestionSize = Min(MaxDNSUDPPacketSize, questionSizeEstimator.minQuestionSize*2)
|
||||
questionSizeEstimator.ewma.Set(float64(questionSizeEstimator.minQuestionSize))
|
||||
questionSizeEstimator.Unlock()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue