Skip to content

Commit 284685e

Browse files
committed
refactor: rename variables
Using `RTT` instead of `Latency` to be consistent with multiple other RTT usages in code. I think mixing "Latency" and "RTT" will make some readers of the code a bit confused.
1 parent 055f055 commit 284685e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gradient.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ func (c *GradientController) update(r Execution) uint {
182182
return queueSize
183183
}
184184

185-
if c.resetNoLoadRTT || c.noLoadRTT > r.Latency {
186-
c.noLoadRTT = r.Latency
185+
if c.resetNoLoadRTT || c.noLoadRTT > r.RTT {
186+
c.noLoadRTT = r.RTT
187187
c.resetNoLoadRTT = false
188188
}
189189

190190
// TODO: Remove this line and make this configurable to be logged or not.
191-
log.Println("Reported latency:", r.Latency, "NoLoadRTT:", c.noLoadRTT)
191+
log.Println("Reported latency:", r.RTT, "NoLoadRTT:", c.noLoadRTT)
192192

193-
gradient := maxf(0.5, minf(1.0, c.rttTolerance*float64(c.noLoadRTT)/float64(r.Latency)))
193+
gradient := maxf(0.5, minf(1.0, c.rttTolerance*float64(c.noLoadRTT)/float64(r.RTT)))
194194

195195
fcurrLimit := float64(currLimit)
196196
var newLimit float64

interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Notifier interface {
1717

1818
type Execution struct {
1919
InFlight uint
20-
Latency time.Duration
20+
RTT time.Duration
2121
Err error
2222
}
2323

0 commit comments

Comments
 (0)