Matthias' strawman patch: prioritise notify_sent based on current ingress / egress rates.
Add a BQ function for this.
Prioritise everything we used to before bug 24966.
Don't prioritise 'reject', it could lead to observable reordering.
Merge in default
Explicitly target an egress/ingress ratio.
Update rates every 1000 messages or at the ram duration timeout, whichever comes first.
Unify the #rates record so we don't duplicate as much stuff.
Cosmetic
oops
Rates on exponential moving average.
Try to get the weighting factor right.
The existing value can be 'undefined'.
Based on some testing, we can reduce this somewhat.
cosmetic
Consistent ordering, and only take account of publishes when deciding whether to update rates (since it's only in conditions of high publish rates that we care).
inline
merge bug25888 into default