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

v7.2.3: Rate-limit policy and codebase maintenance #912

Merged
merged 21 commits into from
Jan 17, 2022
Merged

Conversation

martincostello
Copy link
Member

The issue or feature being addressed

#260 - Add rate-limit policy

Details on the issue fix or feature implementation

#863 - Remove xunit CLI
#864 - Add BenchmarkDotNet benchmarks
#865 - Update to C# 9
#866 - Use embedded NuGet package icon
#867 - Remove redundant ConfigureAwait(false) calls from tests
#869 - Update FluentAssertions
#871 - Code tidy-up
#902 - Fix broken README image
#903 - Add rate-limit policy
#909 - Target .NET 6 in tests
#909 - Update NuGet package dependencies

Confirm the following

  • I started this PR by branching from the head of the latest dev vX.Y branch, or I have rebased on the latest dev vX.Y branch, or I have merged the latest changes from the dev vX.Y branch
  • I have targeted the PR to merge into the latest dev vX.Y branch as the base branch
  • I have included unit tests for the issue/feature
  • I have successfully run a local build

SimonCropp and others added 20 commits June 7, 2021 08:32
it is the default in release
they are inferred from the project name
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
deprecated long ago https://xunit.net/docs/nuget-packages#retired

Co-authored-by: Martin Costello <martin@martincostello.com>
* update to c# 9

* Update Directory.Build.props
* move to PackageIcon

PackageIconUrl is obsolete

* Update src/Polly/Polly.csproj

Co-authored-by: Martin Costello <martin@martincostello.com>

* Update src/Polly/Polly.csproj

Co-authored-by: Martin Costello <martin@martincostello.com>

Co-authored-by: Martin Costello <martin@martincostello.com>
* remove redundant ConfigureAwait

* Update src/Polly.Specs/Timeout/TimeoutTResultAsyncSpecs.cs

Co-authored-by: Martin Costello <martin@martincostello.com>

* Update src/Polly.Specs/Timeout/TimeoutTResultAsyncSpecs.cs

Co-authored-by: Martin Costello <martin@martincostello.com>

* Update src/Polly.Specs/Timeout/TimeoutTResultAsyncSpecs.cs

Co-authored-by: Martin Costello <martin@martincostello.com>

* Update src/Polly.Specs/Timeout/TimeoutTResultAsyncSpecs.cs

Co-authored-by: Martin Costello <martin@martincostello.com>

* Update AsyncPolicy.TResult.cs

Co-authored-by: Martin Costello <martin@martincostello.com>
* FluentAssertions" Version="5.10.3

* Update NoOpTResultAsyncSpecs.cs

* Update AdvancedCircuitBreakerAsyncSpecs.cs
Discard some unused parameters
* Add benchmarks project

Add basic benchmarks project for comparing the latest* NuGet version of Polly with the local project.

* Extend retry benchmarks

Extend the retry benchmarks for more usages.

* Rename class

Remove the Benchmarks suffix.

* More benchmarks

Add more benchmarks for different policies.
Reuse the policies in the Retry benchmarks.

* Remove broken bechmark

Remove benchmark that just hangs.

* Add cache benchmarks

Add benchmarks for the cache policy using the implementation from Polly.Caching.MemoryCache.

* Remove EventPipeProfiler

Remove EventPipeProfiler as it doesn't seem to report anything that useful.

* Remove another hanging benchmark

Remove another benchmark that just hangs indefinitely.

* Add bulkhead to wrap benchmark

Also add a bulkhead policy to the PolicyWrap benchmarks.

* Update BenchmarkDotNet

Update to the latest release of BenchmarkDotNet.

* Use Task.CompletedTask

Use Task.CompletedTask in .NET versions that support it.

* Use TryGetValue()

Use TryGetValue() with dictionary, instead of ContainsKey() and the indexer.

* Use LangVersion latest

Set LangVersion to latest now that BenchmarkDotNet supports it.
* Add core RateLimiter implementations

* Add example async TResult rate-limiter policy implementation

* Add example syntax

* Make the retryAfterFactory take Timespan as an input parameter!

* Initial LockFreeTokenBucketRateLimiterTests

* Tidy BulkheadSpecsHelper

* Factor out test helpers

* Factor out common tests; add tests on lock-based rate limiter

* Allow for slow-running on CI servers

* Add tests on full bucket capacity

* Fix RateLimitRejectedException

* Remove unused configuration overloads

* Introduce a factory for obtaining the preferred rate-limiter implementation

* Pull some test helper methods into a common base-class

* Add first specs on async policy syntax

* Add full set of specs on rate-limit policies thus far

* Add tests on retryAfterFactory

* Add tests on context passed to retryAfterFactory

* Add async non-generic syntax and specs

* Improve code layout

* Add sync rate-limit policies

* Add initial rate-limit doco; bump to v7.2.0

* Improve bulkhead doco in readme

* Minor expressivity refinements

* Neaten bulkhead tests commentary

* Control visibility of IRateLimiter components

* Fix non-generic rate-limit tests to be genuinely non-generic

* Remove LockBasedTokenBucketRateLimiter

Remove the LockBasedTokenBucketRateLimiter class which isn't used other than in tests.

* Throw ArgumentNullException

Throw ArgumentNullException instead of NullReferenceException.

* Pass value to ArgumentOutOfRangeException

Pass the invalid value when throwing ArgumentOutOfRangeException.

* Make LockFreeTokenBucketRateLimiter sealed

Seal the LockFreeTokenBucketRateLimiter class.

* Make RateLimiterFactory static

Make the RateLimiterFactory class static.

* Add parenthesis

Add parenthesis to operation to make it clearer.

* Use string not String

Use the always-unambiguous `string` keyword instead of `String`.
See https://blog.paranoidcoding.com/2019/04/08/string-vs-String-is-not-about-style.html.

* Bump version to 7.3.0

Bump the next version to 7.3.0.

* Fix typo

Remove superfluous dollar character from exception message.

* Code review fixes

Fix exception message typos.
Add access modifier.
Remove blank line after comment.

* Fix links

Change ratelimit to rate-limit.

* Fix typos

Fix various typos, as well as free whitespace trimming from using Atom.

* Add rate-limit documentation

Add documentation for the RateLimit policy.

* Update Cake

Update to the highest 0.x version of Cake and pin to use a version of Cake.FileHelpers and Cake.Yaml released in the same time frame.

* Do not generate benchmarks package

Suppress a NuGet package being created by the benchmarks project.

Co-authored-by: reisenberger <software@reisenberger.net>
* Target .NET 6

Target .NET 6 in the tests and benchmarks.

* Update NuGet packages

Update various NuGet packages to their latest versions.

* Update to Visual Studio 2022

Use the Visual Studio 2022 image for a .NET 6 installation.
If a large numberOfExecutions value (e.g. int.MaxValue) is used with a small perTimeSpan value, the division between the two will create a number too small to be represented by a tick, ending up with a TimeSpan.Zero value.
This then created a confusing exception message saying that the user had specified TimeSpan.Zero, when they hadn't.
Improved the exception message by throwing a specific exception if onePer ends up with a zero or negative value once computed.
Add other contributors' changes for v7.3.0.
@martincostello martincostello merged commit c27faf8 into master Jan 17, 2022
@martincostello martincostello deleted the v723-or-v730 branch January 17, 2022 13:29
@martincostello martincostello changed the title v7.3.0: Rate-limit policy and codebase maintenance v7.2.3: Rate-limit policy and codebase maintenance Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants