We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 034d3bd commit ca076ceCopy full SHA for ca076ce
dnscrypt-proxy/estimators.go
@@ -6,14 +6,18 @@ import (
6
"github.com/lifenjoiner/ewma"
7
)
8
9
+const (
10
+ SizeEstimatorEwmaDecay = 100.0
11
+)
12
+
13
type QuestionSizeEstimator struct {
14
sync.RWMutex
15
minQuestionSize int
16
ewma *ewma.EWMA
17
}
18
19
func NewQuestionSizeEstimator() QuestionSizeEstimator {
- return QuestionSizeEstimator{minQuestionSize: InitialMinQuestionSize, ewma: &ewma.EWMA{}}
20
+ return QuestionSizeEstimator{minQuestionSize: InitialMinQuestionSize, ewma: ewma.NewMovingAverage(SizeEstimatorEwmaDecay)}
21
22
23
func (questionSizeEstimator *QuestionSizeEstimator) MinQuestionSize() int {
0 commit comments