Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PartitionedRateLimiter #1383

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

martintmk
Copy link
Contributor

@martintmk martintmk commented Jul 4, 2023

Details on the issue fix or feature implementation

Implements the following proposal that adds support for PartitionedRateLimiter:

#1365 (comment)

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

@martintmk martintmk added the v8 Issues related to the new version 8 of the Polly library. label Jul 4, 2023
@martintmk martintmk added this to the v8.0.0 milestone Jul 4, 2023
@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Merging #1383 (0082137) into main (22df640) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1383      +/-   ##
==========================================
+ Coverage   83.68%   83.70%   +0.02%     
==========================================
  Files         269      270       +1     
  Lines        6429     6438       +9     
  Branches     1004     1005       +1     
==========================================
+ Hits         5380     5389       +9     
  Misses        840      840              
  Partials      209      209              
Flag Coverage Δ
linux ?
macos 83.70% <100.00%> (+0.02%) ⬆️
windows 83.70% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...olly.RateLimiting/RateLimiterResilienceStrategy.cs 100.00% <100.00%> (ø)
.../RateLimiterResilienceStrategyBuilderExtensions.cs 100.00% <100.00%> (ø)
...c/Polly.RateLimiting/RateLimiterStrategyOptions.cs 100.00% <100.00%> (ø)
src/Polly.RateLimiting/ResilienceRateLimiter.cs 100.00% <100.00%> (ø)

Copy link
Member

@martincostello martincostello left a comment

Choose a reason for hiding this comment

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

The changes look ok, but from the tests I don't understand how the rate limiter would partition on the HTTP context, for example, where the limit is intended to be per client on a particular strategy pipeline.

@martintmk
Copy link
Contributor Author

martintmk commented Jul 4, 2023

The changes look ok, but from the tests I don't understand how the rate limiter would partition on the HTTP context, for example, where the limit is intended to be per client on a particular strategy pipeline.

Let me create an more complex issue test that demonstrates this in follow-up.

@martintmk martintmk enabled auto-merge (squash) July 4, 2023 06:10
@martintmk martintmk merged commit 7945dd4 into main Jul 4, 2023
@martintmk martintmk deleted the mtomka/partitioned-rate-limiter branch July 4, 2023 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v8 Issues related to the new version 8 of the Polly library.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants