Skip to content

Comments

Add delivery rate estimator#27

Merged
mengelbart merged 1 commit intomasterfrom
feat/delivery-rate-estimator
Feb 23, 2026
Merged

Add delivery rate estimator#27
mengelbart merged 1 commit intomasterfrom
feat/delivery-rate-estimator

Conversation

@mengelbart
Copy link
Contributor

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.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1d19464) to head (08ea4d8).
⚠️ Report is 1 commits behind head on master.

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     
Flag Coverage Δ
go 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mengelbart mengelbart requested a review from JoTurk February 20, 2026 10:41
}

func (e *deliveryRateEstimator) getRate() int {
deadline := e.latestArrival.Add(-e.window)
Copy link
Member

@JoTurk JoTurk Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is silly but if window is 0, we won't evict. so maybe we should assert here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand. Wouldn't a window of 0 mean we evict everything before latestArrival?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's ok though, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was just pointing it out in case it's not intended, sorry :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. No worries! Thanks for the review!

@mengelbart mengelbart merged commit d02421a into master Feb 23, 2026
19 checks passed
@mengelbart mengelbart deleted the feat/delivery-rate-estimator branch February 23, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants