Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions client/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,18 +332,18 @@ type ewmaLatency struct {
measured bool
}

func (l ewmaLatency) Update(val time.Duration) {
func (l *ewmaLatency) Update(val time.Duration) {
l.measured = true
l.val /= 2
l.val += (val / 2)
}

func (l ewmaLatency) Reset() {
func (l *ewmaLatency) Reset() {
l.val = 0
l.measured = false
}

func (l ewmaLatency) Better(r ewmaLatency) bool {
func (l *ewmaLatency) Better(r ewmaLatency) bool {
// if l is not measured (it also means last measurement was
// a failure), any updated/measured latency is better than
// l. Also if neither l or r is measured, l can't be better
Expand Down