Skip to content

Implement TCP-Vegas Style Adaptive Concurrency Limits (#32)#37

Merged
cinar merged 1 commit intomainfrom
feature/adaptive-concurrency
Apr 2, 2026
Merged

Implement TCP-Vegas Style Adaptive Concurrency Limits (#32)#37
cinar merged 1 commit intomainfrom
feature/adaptive-concurrency

Conversation

@cinar
Copy link
Copy Markdown
Owner

@cinar cinar commented Apr 2, 2026

This pull request implements dynamic concurrency limits using the TCP-Vegas algorithm (AIMD based on RTT), as specified in issue #32.

Key Changes:

  • AdaptiveLimiter: Dynamic concurrency control using Additive Increase, Multiplicative Decrease.
  • Middleware Integration: Added to the default execution pipeline.
  • Functional Options: New and options.
  • Documentation: New technical article and updates to existing articles.
  • Testing: 100% statement coverage for the new implementation.

Fixes #32

- Introduce AdaptiveLimiter with AIMD logic based on RTT.
- Implement adaptive concurrency middleware and policy integration.
- Add WithAdaptiveLimiter and WithAdaptiveLimiterInstance options.
- Ensure zero-allocation on the happy path.
- Add baseline RTT decay for environment recalibration.
- Comprehensive unit tests with >90% coverage.
- Add standalone example and technical article.
- Update existing articles to reference adaptive concurrency.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.25%. Comparing base (3cae080) to head (98fd5e0).

Files with missing lines Patch % Lines
options.go 50.00% 5 Missing ⚠️
retry.go 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   80.82%   81.25%   +0.43%     
==========================================
  Files          11       12       +1     
  Lines         652      715      +63     
==========================================
+ Hits          527      581      +54     
- Misses        103      110       +7     
- Partials       22       24       +2     

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

@cinar cinar merged commit 3a9c6cb into main Apr 2, 2026
4 checks passed
@cinar cinar deleted the feature/adaptive-concurrency branch April 2, 2026 16:21
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.

TCP-Vegas Style Adaptive Concurrency Limits

2 participants