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

Fix rounding on iteration-distribution calculations #141

Merged
merged 2 commits into from
Jun 11, 2024

Conversation

jrpeon-form3
Copy link
Contributor

Description

Co-authored-by: Kevin Intriago kevin.intriago@form3.tech

When using very low rates intended to only fire the scenario a couple times over the duration, the calculations for the iteration distribution could fail to add up to 1 by the last tick of the iteration, missing executions (or failing to trigger the scenario at all if only 1 run was intended).

Using Ceil instead of Round ensures 1 is always reached consistently. See added test cases for examples that would fail to trigger the scenario without the fix.

@jrpeon-form3 jrpeon-form3 requested a review from a team as a code owner October 27, 2023 13:41
@jrpeon-form3 jrpeon-form3 changed the title Fix rounding on interation-distribution calculations Fix rounding on iteration-distribution calculations Oct 31, 2023
@nvloff-f3 nvloff-f3 force-pushed the fix-iteration-distribution-rounding branch 2 times, most recently from c1ca547 to 72dc431 Compare June 4, 2024 05:55
jrpeon-form3 and others added 2 commits June 10, 2024 17:43
When using  very low rates intended to only fire the scenarios
a couple times over the duration, the calculations for the
iteration distribution could fail to add up to 1 by the last
tick of the iteration.

Using `Ceil` instead of `Round` ensures 1 is always reached consistently.

See added test cases for examples that would fail to trigger the scenario
without the fix.

Co-authored-by: Kevin Intriago <kevin.intriago@form3.tech>
@nvloff-f3 nvloff-f3 force-pushed the fix-iteration-distribution-rounding branch from 994e344 to 817300c Compare June 10, 2024 14:43
@nvloff-f3 nvloff-f3 merged commit 2e876df into master Jun 11, 2024
4 checks passed
@nvloff-f3 nvloff-f3 deleted the fix-iteration-distribution-rounding branch June 11, 2024 08: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.

None yet

3 participants