Closed shijiesheng closed 2 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
internal/common/autoscaler/recommender.go | 21 | 22 | 95.45% | ||
internal/internal_poller_autoscaler.go | 80 | 82 | 97.56% | ||
<!-- | Total: | 107 | 110 | 97.27% | --> |
Totals | |
---|---|
Change from base Build 01826fe7-7f06-47b4-bbe2-421af8f4fde0: | 0.2% |
Covered Lines: | 12539 |
Relevant Lines: | 19573 |
What changed?
Why?
Pollers constantly poll the cadence-frontend for tasks even though there are no tasks. To reduce unnecessary polling, an autoscaler is used to limit the number of concurrent polls. This PR addresses the implementation of polleraAutoscaler and there will be a follow-up PR to add the autoscaler on pollers.
As for the design of autoscaler, a resizable semaphore is used to limit concurrency.
How did you test it?
unit tests
Potential risks