Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #27 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 2 +1
Lines 31 72 +41
=========================================
+ Hits 31 72 +41
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| func (e *deliveryRateEstimator) getRate() int { | ||
| deadline := e.latestArrival.Add(-e.window) |
There was a problem hiding this comment.
this is silly but if window is 0, we won't evict. so maybe we should assert here?
There was a problem hiding this comment.
I'm not sure I understand. Wouldn't a window of 0 mean we evict everything before latestArrival?
There was a problem hiding this comment.
Sorry i didn't explain well, but with window=0, we don't evict history with arrival = latestArrival. because of (*e.history)[0].arrival.Before(deadline).
There was a problem hiding this comment.
I think that's ok though, no?
There was a problem hiding this comment.
Yeah I was just pointing it out in case it's not intended, sorry :)
There was a problem hiding this comment.
Ok. No worries! Thanks for the review!
Add the delivery rate estimator. It measures the actual delivered rate, which is used to update the rate and, e.g., to ensure we don't increase the target rate too far above the rate actually used.