Skip to content

Commit

Permalink
fix a bug in adaptive_threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
guangjinpan authored and Sean-Der committed Apr 25, 2023
1 parent 54caf4d commit 7355501
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/gcc/adaptive_threshold.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (a *adaptiveThreshold) update(estimate time.Duration) {
timeDelta := time.Duration(minInt(int(now.Sub(a.lastUpdate).Milliseconds()), int(maxTimeDelta.Milliseconds()))) * time.Millisecond
d := absEstimate - a.thresh
add := k * float64(d.Milliseconds()) * float64(timeDelta.Milliseconds())
a.thresh += time.Duration(add) * 1000 * time.Microsecond
a.thresh += time.Duration(add * 1000) * time.Microsecond
a.thresh = clampDuration(a.thresh, a.min, a.max)
a.lastUpdate = now
}

0 comments on commit 7355501

Please sign in to comment.