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

Addijitter #51

Merged
merged 2 commits into from
Dec 20, 2024
Merged

Addijitter #51

merged 2 commits into from
Dec 20, 2024

Conversation

heckj
Copy link
Owner

@heckj heckj commented Dec 20, 2024

Description

Adds a jitter value to the delay in a retry backoff so that there isn't a possibility of hammering concurrently. +/- 5% of base value, never below 0, never above max.

Motivation and Context

resolves #50

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected. Examples include renaming parameters in public API, removing public API, or adding a new parameter to public API without a default value.)

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have run ./scripts/preflight.bash and it passed without errors.

@heckj heckj self-assigned this Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 87.17949% with 5 lines in your changes missing coverage. Please review.

Project coverage is 72.90%. Comparing base (7875473) to head (c7cd3af).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Formic/Backoff.swift 86.84% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   72.44%   72.90%   +0.46%     
==========================================
  Files          20       20              
  Lines        1223     1255      +32     
==========================================
+ Hits          886      915      +29     
- Misses        337      340       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@heckj heckj merged commit 9b95666 into main Dec 20, 2024
3 checks passed
@heckj heckj deleted the addijitter branch December 20, 2024 22:27
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.

add slight jitter to backoff calculation
1 participant