Skip to content

Extend LogNormal to add an optional maxValue#3026

Merged
leeturner merged 6 commits into
wiremock:masterfrom
Vodafone:feature/add_truncation_of_long_tails_to_lognormal
Apr 23, 2025
Merged

Extend LogNormal to add an optional maxValue#3026
leeturner merged 6 commits into
wiremock:masterfrom
Vodafone:feature/add_truncation_of_long_tails_to_lognormal

Conversation

@paul-poulain-vodafone

Copy link
Copy Markdown
Contributor

Extend LogNormal to add an optional maxValue to force long tails to be truncated and the value resampled if greater than the max. The reason this might be necessary is that with some log normal configurations, a curve with quite a long tail can be experienced that can cause unexpected or unwanted timeouts in upstream systems. Setting a maximum delay value can prevent this from happening. If the value generated is greater than the max, then it is resampled a number of times (10) and then finally, the max of the two values is taken (to prevent resampling indefinitely)

Documentation changes will be raised in a subsequent PR but look as follows:

image

References

  • This changes replaces this original PR which had CappedLogNormal as a new subclass of LogNormal

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

paul-poulain-vodafone and others added 6 commits April 8, 2025 17:22
…e truncated and the value resampled if greater than the max.
Under some circumstances, the log normal distribution can create an extra long tail that might cause
unwanted timeouts in upstream systems. Therefore, this changed adds the option to specify a maximum
value that should be generated.
@paul-poulain-vodafone

Copy link
Copy Markdown
Contributor Author

@tomakehurst and all, this is a replacement PR for #1694 that enhances LogNormal rather than adding a new subclass, as Tom proposed, thanks.

@paul-poulain-vodafone

Copy link
Copy Markdown
Contributor Author

Documentation PR is here: wiremock/wiremock.org#353

@leeturner leeturner merged commit 0da30c8 into wiremock:master Apr 23, 2025
@leeturner

Copy link
Copy Markdown
Contributor

Thank you for your contribution

@paul-poulain-vodafone paul-poulain-vodafone deleted the feature/add_truncation_of_long_tails_to_lognormal branch April 24, 2025 08:32
josetruta pushed a commit to grupo5-ES-2025-1/wiremock that referenced this pull request Aug 31, 2025
…_of_long_tails_to_lognormal

Extend LogNormal to add an optional maxValue
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.

2 participants