Skip to content

Commit 7956ba5

Browse files
committed
Switch to an ewma fork that allows setting the warmup samples #
1 parent 9ec8a35 commit 7956ba5

11 files changed

Lines changed: 9 additions & 313 deletions

File tree

dnscrypt-proxy/estimators.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"sync"
55

6-
"github.com/VividCortex/ewma"
6+
"github.com/jedisct1/ewma"
77
)
88

99
const (

dnscrypt-proxy/serversInfo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"sync"
1616
"time"
1717

18-
"github.com/VividCortex/ewma"
1918
"github.com/jedisct1/dlog"
19+
"github.com/jedisct1/ewma"
2020
clocksmith "github.com/jedisct1/go-clocksmith"
2121
stamps "github.com/jedisct1/go-dnsstamps"
2222
"github.com/miekg/dns"
@@ -266,7 +266,7 @@ func (serversInfo *ServersInfo) estimatorUpdate() {
266266
partialSort = true
267267
} else if candidateRtt > 0 && candidateRtt >= (serversInfo.inner[0].rtt.Value()+serversInfo.inner[activeCount-1].rtt.Value())/2.0*4.0 {
268268
if time.Since(serversInfo.inner[candidate].lastActionTS) > time.Duration(1*time.Minute) {
269-
serversInfo.inner[candidate].rtt.Add(candidateRtt/2.0)
269+
serversInfo.inner[candidate].rtt.Add(candidateRtt / 2.0)
270270
dlog.Debugf("Giving a new chance to candidate [%s], lowering its RTT from %d to %d (best: %d)", serversInfo.inner[candidate].Name, int(candidateRtt), int(serversInfo.inner[candidate].rtt.Value()), int(serversInfo.inner[0].rtt.Value()))
271271
partialSort = true
272272
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.17
44

55
require (
66
github.com/BurntSushi/toml v1.0.0
7-
github.com/VividCortex/ewma v1.2.0
87
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
98
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185
109
github.com/hashicorp/go-immutable-radix v1.3.1
1110
github.com/hashicorp/golang-lru v0.5.4
1211
github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95
1312
github.com/jedisct1/dlog v0.0.0-20210927135244-3381aa132e7f
13+
github.com/jedisct1/ewma v1.2.1-0.20220220223311-a30af446ecb9
1414
github.com/jedisct1/go-clocksmith v0.0.0-20210101121932-da382b963868
1515
github.com/jedisct1/go-dnsstamps v0.0.0-20210810213811-61cc83d2a354
1616
github.com/jedisct1/go-hpke-compact v0.0.0-20210930135406-0763750339f0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
5252
github.com/OpenPeeDeeP/depguard v1.0.1 h1:VlW4R6jmBIv3/u1JNlawEvJMM4J+dPORPaZasQee8Us=
5353
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
5454
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
55-
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
56-
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
5755
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
5856
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
5957
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -353,6 +351,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
353351
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
354352
github.com/jedisct1/dlog v0.0.0-20210927135244-3381aa132e7f h1:XICcphytniQKdtd4FGrK0b1ERzS7FBvFtVUCReSppmU=
355353
github.com/jedisct1/dlog v0.0.0-20210927135244-3381aa132e7f/go.mod h1:35aII3PkLMvmc8daWy0vcZXDU+a40lJczHHTFRJmnvw=
354+
github.com/jedisct1/ewma v1.2.1-0.20220220223311-a30af446ecb9 h1:U5QPCoM1KkMJ9RfEfP0joKNwwwIHG1oP9RzjvQTuh98=
355+
github.com/jedisct1/ewma v1.2.1-0.20220220223311-a30af446ecb9/go.mod h1:qCWdft6DX9wxyNsUS+sxS44UkxE7eQnNtBttTWoW0cU=
356356
github.com/jedisct1/go-clocksmith v0.0.0-20210101121932-da382b963868 h1:QZ79mRbNwYYYmiVjyv+X0NKgYE6nyN1yo3gtEFdzpiE=
357357
github.com/jedisct1/go-clocksmith v0.0.0-20210101121932-da382b963868/go.mod h1:SAINchklztk2jcLWJ4bpNF4KnwDUSUTX+cJbspWC2Rw=
358358
github.com/jedisct1/go-dnsstamps v0.0.0-20210810213811-61cc83d2a354 h1:sIB9mDh2spQdh95jeXF2h9uSNtObbehD0YbDCzmqbM8=

vendor/github.com/VividCortex/ewma/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

vendor/github.com/VividCortex/ewma/.whitesource

Lines changed: 0 additions & 3 deletions
This file was deleted.

vendor/github.com/VividCortex/ewma/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

vendor/github.com/VividCortex/ewma/README.md

Lines changed: 0 additions & 145 deletions
This file was deleted.

vendor/github.com/VividCortex/ewma/codecov.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

vendor/github.com/VividCortex/ewma/ewma.go

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)