envoy
envoy copied to clipboard
admission control filter: Fix average RPS calculation
This patch fixes a bug in the thread-local controller's average RPS calculation. The controller was erroneously calculating the average over the time elapsed since the oldest valid sample, which is incorrect. This can result in erratic load shedding behavior for bursty request distributions.
The correct behavior is to calculate the average RPS over the full lookback window.
Risk Level: Low Testing: Unit test Docs Changes: n/a Release Notes: Documented the bugfix. Fixes #33739